weldr/lorax

Problem zeroing free blocks on livemedia-creator RHEL/CentOS 8

disjustin opened this issue · 2 comments

Red Hat Enterprise Linux release 8.9 (Ootpa)
lorax-28.14.70-1.el8.x86_64

I'm encountering the following issue which applies to livemedia-creator --make-iso and --make-pxe-live. Reproducible on CentOS Stream 8:
livemedia.log

ERROR Problem zeroing free blocks of /root/.../lmc-disk-zrjj0mv5.img
ERROR pylorax: squashfs.img creation failed
ERROR livemedia-creator: squashfs.img creation failed

program.log

Running... /usr/sbin/fsck.ext4 -y -f -E discard /root/Documents/Documents/results_novirt_2404111703/lmc-disk-zrjj0mv5.img
e2fsck 1.45.6 (20-Mar-2020)
/root/Documents/Documents/results_novirt_2404111703/lmc-disk-zrjj0mv5.img is mounted.
e2fsck: Cannot continue, aborting.


Return code: 8

Command I ran:
livemedia-creator --make-iso --nomacboot --ks rhel8-simple.ks --no-virt --resultdir ./results_novirt_$(date +%y%m%d%H%M)
rhel8-simple.ks

lang en_US
keyboard us
timezone America/Los_Angeles --utc
# root password is password
rootpw password
shutdown
url --url=http://192.168.16.57/rhel-89/repos/BaseOS
repo --name=appstream --baseurl=http://192.168.16.57/rhel-89/repos/AppStream
bootloader --location=none
zerombr
clearpart --all --initlabel
reqpart
part / --size=6656
network --bootproto=dhcp
skipx
firstboot --disable
selinux --disabled
firewall --disable
%packages
isomd5sum
kernel
memtest86+
syslinux
-dracut-config-rescue
dracut-config-generic
dracut-live
system-logos
selinux-policy-targeted
shim
shim-ia32
grub2
grub2-efi
grub2-efi-*-cdboot
grub2-efi-ia32
efibootmgr
%end

Some more insight on the issue. Appears the filesystem image is not properly unmounted prior to it's execution. Here's the cli output on another attempt for --make-pxe-live option:

2024-04-11 18:00:42,622: Shutting down log processing
2024-04-11 18:00:44,978: Disk Image install successful
2024-04-11 18:00:44,978: working dir is /var/tmp/lmc-work-sp2b2ch6
2024-04-11 18:00:44,996: Problem zeroing free blocks of /root/Documents/Documents/results_novirt_2404111755/lmc-disk-fzhkyrod.img
2024-04-11 18:00:44,996: Creating PXE live image failed.
2024-04-11 18:00:44,996: Creating PXE live image failed.
[root@localhost Documents]# fsck.ext4 -y -f -E discard /root/Documents/Documents/results_novirt_2404111755/lmc-disk-fzhkyrod.img 
e2fsck 1.45.6 (20-Mar-2020)
/root/Documents/Documents/results_novirt_2404111755/lmc-disk-fzhkyrod.img is mounted.



WARNING!!!  The filesystem is mounted.   If you continue you ***WILL***
cause ***SEVERE*** filesystem damage.


Do you really want to continue<n>? no
check aborted.
[root@localhost Documents]# mount -l | grep lmc-disk
/root/Documents/Documents/results_novirt_2404111755/lmc-disk-fzhkyrod.img on /run/media/root/Anaconda type ext4 (rw,nosuid,nodev,relatime,seclabel,errors=remount-ro,uhelper=udisks2) [Anaconda]
[root@localhost Documents]# umount /run/media/root/Anaconda 
[root@localhost Documents]# fsck.ext4 -y -f -E discard /root/Documents/Documents/results_novirt_2404111755/lmc-disk-fzhkyrod.img 
e2fsck 1.45.6 (20-Mar-2020)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Anaconda: 36542/458752 files (0.1% non-contiguous), 533497/1832448 blocks
[root@localhost Documents]# 
bcl commented

Please file RHEL issues at https://issues.redhat.com

FWIW on first glance this looks odd, results_novirt_2404111755/lmc-disk-fzhkyrod.img on /run/media/root/Anaconda makes me wonder if something is automounting it for some reason. lmc does not use /run/media/ for anything. Maybe try not passing ``-resultdirand let it make a temporary directory in/var/tmp`.

(but please followup after filing an issue, not here.