Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
DescriptionRichard W.M. Jones
2014-02-11 21:20:18 UTC
Description of problem:
(Reported by Jeff Bastien here:
https://bugzilla.redhat.com/show_bug.cgi?id=1064008#c20 )
# virt-sparsify opensuse.img --convert qcow2 opensuse.qcow2qemu-img version 1.5
Create overlay file to protect source disk ...
Examine source disk ...
◓ 25% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒═════════════════════════════════════════════════⟧ --:--
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
Fill free space in /dev/sda5 with zero ...
Clearing Linux swap on /dev/sda6 ...
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
Fill free space in /dev/sda7 with zero ...
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
Fill free space in /dev/sda8 with zero ...
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:--
Fill free space in btrfsvol:/dev/sda7/.snapshots with zero ...
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ --:--
Fill free space in btrfsvol:/dev/sda7/.snapshots/1/snapshot with zero ...
Fatal error: exception Guestfs.Error("zero_free_space: open: /sysroot//qvm8re6w.spf: Read-only file system")
Version-Release number of selected component (if applicable):
libguestfs 1.22.6-20.el7
Comment 2Richard W.M. Jones
2014-02-11 21:27:57 UTC
Reproducer:
---------------------------------------------------------------
guestfish -x -N fs:btrfs -m /dev/sda1 <<EOF
btrfs-subvolume-create /vol1
# libguestfs has no API for this yet:
debug sh "btrfs subvolume snapshot -r /sysroot/vol1 /sysroot/snapshot"
# This will fail with the same error as virt-sparsify:
-zero-free-space /snapshot
EOF
virt-sparsify test1.img test1-out.img
---------------------------------------------------------------
The virt-sparsify command at the end will fail with:
Input disk virtual size = 104857600 bytes (100.0M)
Create overlay file in /tmp to protect source disk ...
Examine source disk ...
Fill free space in /dev/sda1 with zero ...
Fill free space in btrfsvol:/dev/sda1/snapshot with zero ...
Fatal error: exception Guestfs.Error("zero_free_space: open: /sysroot//idpr6elo.o7z: Read-only file system")
Comment 3Richard W.M. Jones
2014-02-11 21:31:01 UTC
Virt-sparsify should generally avoid read-only filesystems.
The same thing would happen if, for example, there was an ISO9660
filesystem contained in any partition and you tried to sparsify
the disk image.
Comment 4RHEL Program Management
2014-03-22 06:03:45 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Verified with the packages:
libguestfs-1.32.5-6.el7.x86_64
Verify steps:
1. Prepare a RHEL guest image with a snapshot:
# qemu-img snapshot -l rhel7.1.qcow2
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 snapshot1 0 2016-06-28 10:35:03 00:00:00.000
2. virt-sparsify rhel7.1.qcow2 --convert raw rhel7.1.raw
[ 0.1] Create overlay file in /tmp to protect source disk
[ 0.1] Examine source disk
[ 2.7] Fill free space in /dev/rhel/root with zero
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
[ 290.1] Clearing Linux swap on /dev/rhel/swap
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
[ 313.8] Fill free space in /dev/sda1 with zero
[ 314.4] Fill free space in /dev/sda2 with zero
[ 315.5] Fill free space in volgroup rhel with zero
[ 324.8] Copy to destination and make sparse
[ 757.1] Sparsify operation completed with no errors.
virt-sparsify: Before deleting the old disk, carefully check that the
target disk boots and works correctly.
No error occurs.
So Verified.
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