Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1364347 - virt-sparsify --in-place failed with UEFI system
virt-sparsify --in-place failed with UEFI system
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs (Show other bugs)
7.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-05 03:16 EDT by Xianghua Chen
Modified: 2016-11-03 14:03 EDT (History)
2 users (show)

See Also:
Fixed In Version: libguestfs-1.32.6-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:03:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2576 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 08:06:51 EDT

  None (edit)
Description Xianghua Chen 2016-08-05 03:16:25 EDT
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 06:02:08 EDT
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 07:23:38 EDT
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 01:24:26 EDT
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 14:03:18 EDT
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.