RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1364347 - virt-sparsify --in-place failed with UEFI system
Summary: virt-sparsify --in-place failed with UEFI system
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-05 07:16 UTC by Xianghua Chen
Modified: 2016-11-03 18:03 UTC (History)
2 users (show)

Fixed In Version: libguestfs-1.32.6-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:03:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log.virt-sparsify.uefi.x86_64 (67.94 KB, text/plain)
2016-08-05 07:16 UTC, Xianghua Chen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 0 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 12:06:51 UTC

Description Xianghua Chen 2016-08-05 07:16:25 UTC
Created attachment 1187786 [details]
log.virt-sparsify.uefi.x86_64

Description of problem:
virt-sparsify --in-place failed with UEFI system
You can see the full log with -v -x in the attachment.

Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.33.46-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Prepare an UEFI guest image: rhel7.2-uefi-x86_64.qcow2
2.
#  virt-sparsify --in-place rhel7.2-uefi-x86_64.qcow2
[   2.1] Trimming /dev/rhel/root
[   2.4] Clearing Linux swap on /dev/rhel/swap
[   2.4] Trimming /dev/sda1
virt-sparsify: error: libguestfs error: fstrim: fstrim: /sysroot/: the
discard operation is not supported

If reporting bugs, run virt-sparsify with debugging enabled and include the
complete output:

  virt-sparsify -v -x [...]


Actual results:
As above output.

Expected results:
The command should finished successfully.

Additional info:
The command also failed with:
  rhel7.2-uefi-aarch64.qcow2
  coreos
  reactos/windows(That may be alright because the filesystem is vfat,etc.)

Comment 1 Richard W.M. Jones 2016-08-05 10:02:08 UTC
A one-line reproducer is:

$ guestfish -N fs:vfat exit && virt-sparsify --in-place test1.img
[   3.5] Trimming /dev/sda1
virt-sparsify: error: libguestfs error: fstrim: fstrim: /sysroot/: the 
discard operation is not supported

A more interesting reproducer is:

$ guestfish -N bootroot:vfat:ext4 exit && virt-sparsify --in-place test1.img
[   3.3] Trimming /dev/sda1
virt-sparsify: error: libguestfs error: fstrim: fstrim: /sysroot/: the 
discard operation is not supported

The difference between the two reproducers is that the first one
creates a test disk containing only a single vfat partitions.  The
second one creates something which looks more like our UEFI situation:
two partitions, vfat & ext4.

In the first test case you could argue that virt-sparsify should fail
(because nothing could be sparsified).

In the second case you could argue that virt-sparsify should issue a
warning, but try to sparsify as much as it can, since the ext4 partition
can be sparsified (but isn't).

Comment 2 Richard W.M. Jones 2016-08-05 11:23:38 UTC
Patches posted upstream:

https://www.redhat.com/archives/libguestfs/2016-August/msg00029.html

These only add a warning.  It's complicated to add an error
as described in comment 1.

Comment 4 Xianghua Chen 2016-08-08 05:24:26 UTC
Verified with packages:
libguestfs-1.32.6-5.el7.x86_64

Verify steps:
1. # guestfish -N bootroot:vfat:ext4 exit && virt-sparsify --in-place test1.img
[   1.5] Trimming /dev/sda1
virt-sparsify: warning: fstrim operation is not supported on /dev/sda1 
(vfat).  Suppress this warning using '--ignore /dev/sda1', or use copying 
mode instead.
[   1.6] Trimming /dev/sda2
[   2.1] Sparsify in-place operation completed with no errors

There is a warning for vfat filesystem.And the size of the test1.img is sparsified.


2. # guestfish -N bootroot:vfat:ext4 exit && virt-sparsify --in-place test1.img --ignore /dev/sda1
[   1.5] Trimming /dev/sda2
[   2.0] Sparsify in-place operation completed with no errors

No error occurred. And the size of the test1.img is sparsified.

So verified.

Comment 6 errata-xmlrpc 2016-11-03 18:03:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2576.html


Note You need to log in before you can comment on or make changes to this bug.