Description of problem: lvcreate fails to wipe signatures of logical volume in rhel8.4. We hit this issue in rhel8.3 for the first time, and then it was fixed. Please refer to bug 1869118 and bug 1868169. Right now we encountered this issue again. Version-Release number of selected component (if applicable): libguestfs-1.44.0-1.module+el8.4.0+9398+f376ac33.x86_64 lvm2-2.03.11-4.el8.x86_64 kernel-4.18.0-287.el8.x86_64 How reproducible: 100% Steps: 1. On rhel8.4 host with RHEL-8.4.0-20210218.0 compose # qemu-img create -f raw test.img 1G Formatting 'test.img', fmt=raw size=1073741824 2. # guestfish -a test.img ><fs> run ><fs> pvcreate /dev/sda ><fs> vgcreate vol_test /dev/sda ><fs> lvcreate vol_file1 vol_test 1000 ><fs> mkfs ext2 /dev/vol_test/vol_file1 ><fs> vgremove vol_test ><fs> vgcreate vol_test /dev/sda ><fs> lvcreate vol_file2 vol_test 500 libguestfs: error: lvcreate: WARNING: ext2 signature detected on /dev/vol_test/vol_file2 at offset 1080. Wipe it? [y/n]: [n] Aborted wiping of ext2. 1 existing signature left on the device. Failed to wipe signatures on logical volume vol_test/vol_file2. Aborting. Failed to wipe start of new LV. ><fs> Actual results: As above Expected results: The lvcreate command can be executed successfully. Additional info:
Here is the one-line reproducer: $ guestfish -N lvfs vgremove VG : vgcreate VG /dev/sda1 : lvcreate LV2 VG 100 libguestfs: error: lvcreate: WARNING: ext2 signature detected on /dev/VG/LV2 at offset 1080. Wipe it? [y/n]: [n] Aborted wiping of ext2. 1 existing signature left on the device. Failed to wipe signatures on logical volume VG/LV2. Aborting. Failed to wipe start of new LV. Adding -vx options shows what command is actually run: commandrvf: lvm lvcreate -L 100 -n LV2 VG We don't use the --yes option, and perhaps we should. There is bug https://bugzilla.redhat.com/show_bug.cgi?id=1894692 which is a new regression against RHEL 8.4. But it seems that LVM has not really been fixed again, since QA is now always using the --yes option.
Upstream fix: https://github.com/libguestfs/libguestfs/commit/21cd97732c4973db835b8b6540c8ad582ebd2bda
Verified with package: libguestfs-1.44.0-2.module+el8.4.0+10146+75917d2f.x86_64 Steps: 1. On rhel8.4 host $ guestfish -N lvfs vgremove VG : vgcreate VG /dev/sda1 : lvcreate LV2 VG 100 No error like "error: lvcreate: WARNING: ext2 signature detected on /dev/VG/LV2 at offset 1080. Wipe it? [y/n]: [n]"
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 (virt:av bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2021:2098