-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
rhel-8.10, rhel-9.5
-
None
-
No
-
Moderate
-
rhel-sst-cs-bootloaders
-
ssg_core_services
-
5
-
False
-
-
None
-
Red Hat Enterprise Linux
-
None
-
None
-
None
-
None
What were you trying to do that didn't work?
A customer is trying to reinstall a system while having the DVD content stored on a local hard disk partition with label "frlabel". For this to occur, he makes use of the following kernel command line parameters:
root=live:LABEL=frlabel rd.live.dir=/images/ rd.live.squashimg=install.img rd.live.image=1 rd.live.ram=1
The mounting of /run/initramfs/live then fails because the /sbin/dmsquash-live-root script is executed twice, which ends up failing the second time:
[ 16.246086] localhost dracut-initqueue[1704]: mount: /run/initramfs/live: /dev/sda1 already mounted on /run/initramfs/live.
[ 16.339592] localhost dracut: FATAL: Failed to mount block device of live image
[ 16.340094] localhost dracut: Refusing to continue
Below is my analysis.
- The udev rules are generated
[ 4.985811] localhost dracut-pre-udev[717]: /lib/dracut-lib.sh@415(source_all): . //lib/dracut/hooks/pre-udev/30-dmsquash-live-genrules.sh [ 4.985811] localhost dracut-pre-udev[717]: ///lib/dracut/hooks/pre-udev/30-dmsquash-live-genrules.sh@3(source): case "$root" in [ 4.985811] localhost dracut-pre-udev[717]: ///lib/dracut/hooks/pre-udev/30-dmsquash-live-genrules.sh@6(source): printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' disk/by-label/frlabel /dev/disk/by-label/frlabel [ 4.985811] localhost dracut-pre-udev[717]: ///lib/dracut/hooks/pre-udev/30-dmsquash-live-genrules.sh@8(source): printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' disk/by-label/frlabel /dev/disk/by-label/frlabel [ 4.985811] localhost dracut-pre-udev[717]: ///lib/dracut/hooks/pre-udev/30-dmsquash-live-genrules.sh@11(source): wait_for_dev -n /dev/disk/by-label/frlabel
- The device shows up, causing udev to setup the hook
- The hook executes the first time, which succeeds
[ 6.091614] localhost dracut-initqueue[987]: //lib/dracut/hooks/initqueue/settled/dmsquash-live-root.sh@1(): '[' -e /lib/dracut/hooks/initqueue/settled/dmsquash-live-root.sh ']' [ 6.091614] localhost dracut-initqueue[987]: //lib/dracut/hooks/initqueue/settled/dmsquash-live-root.sh@1(): rm -f -- /lib/dracut/hooks/initqueue/settled/dmsquash-live-root.sh [ 6.092178] localhost dracut-initqueue[987]: //lib/dracut/hooks/initqueue/settled/dmsquash-live-root.sh@2(): /sbin/dmsquash-live-root /dev/disk/by-label/frlabel :
- Multipath enters the game, which cancels waiting on the disk after some time, causing a udevadm trigger to execute
[ 15.748695] localhost systemd[1]: cancel-multipath-wait-sda.service: About to execute /usr/bin/udevadm trigger --action=add /sys/devices/pci0000:00/0000:00:02.6/0000:07:00.0/virtio5/host0/target0:0:0/0:0:0:0/block/sda
- This udevadm trigger makes the udev rule setup the hook again
[ 15.808656] localhost systemd-udevd[1620]: sda1: /usr/lib/udev/rules.d/60-persistent-storage.rules:142 LINK 'disk/by-label/frlabel'
- The hook executes a second time, which fails
[ 16.183652] localhost dracut-initqueue[987]: //lib/dracut/hooks/initqueue/settled/dmsquash-live-root.sh@2(): /sbin/dmsquash-live-root /dev/disk/by-label/frlabel : [ 16.245330] localhost dracut-initqueue[1655]: + mount -n -t ext4 -o ro /dev/disk/by-label/frlabel /run/initramfs/live [ 16.246086] localhost dracut-initqueue[1704]: mount: /run/initramfs/live: /dev/sda1 already mounted on /run/initramfs/live. [ 16.339592] localhost dracut: FATAL: Failed to mount block device of live image
Clearly something has to be done to avoid the hook from executing multiple times. I see 2 solutions
- Either the udev rule has to be modified to not execute if /run/initramfs/live is already present (hence mounted)
In /lib/dracut/hooks/pre-udev/30-dmsquash-live-genrules.sh:printf 'KERNEL=="%s", TEST!="/run/initramfs/live", RUN+="/sbin/initqueue ... printf 'SYMLINK=="%s", TEST!="/run/initramfs/live", RUN+="/sbin/initqueue ...
- Or /sbin/dmsquash-live-root has to be made re-entrant
What is the impact of this issue to you?
Customer cannot reinstall systems
Please provide the package NVR for which the bug is seen:
dracut on RHEL8.10 and RHEL9.5
How reproducible is this bug?:
Always
Steps to reproduce
- Setup a QEMU/KVM with 2 disks, one at least as SCSI disk (to trigger multipath)
- On the second disk, create a EXT4 partition that will store the RHEL DVD content and label it with "frlabel"
- Copy the DVD base content ti the EXT4 partition
- Boot the system for installation with described kernel command line
Expected results
Actual results
Workaround
A workaround is to boot with inst.wait_for_disks=0 so that the boot doesn't get delayed, hence "multipath cancel" operation doesn't execute at all, which prevents udevadm trigger from occurring, hence setting up the "settled" hook twice.
This workaround may not work, depending on the dynamic of the boot (multipath cancels after 10 seconds).