Description
Describe the bug
rd.writable.fsimg=1 causes the live image to be unpacked and copied into RAM.
This used to work on F40 with a small modification of remounting /run to a larger size.
That problem is described here #2550
On F41 this workaround no longer works.
After remounting /run to the larger size, boot fails with:
mount: /run/rootfsbase: fsconfig system call failed: /dev/loop1: Can't open blockdev
The problem happens on this line of dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh:
mount -r $FSIMG /run/rootfsbase
mount -r /run/initramfs/fsimg/rootfs.img /run/rootfsbase
Can someone please point me to how to debug this further? I would like to find a workaround or a fix. Thanks.
I can not find any reason why mount can not open the blockdev.
Doing exactly the same on F40 works fine. All logs I tried do not have any further information.
Below is a modification of a dracut script that works on F40 and fails as above on F41:
dracut/modules.d/90dmsquash-live/dmsquash-live-root.sh
From line 368 to the end of the file.
if [ -n "$FSIMG" ]; then
if [ -n "$writable_fsimg" ]; then
# mount the provided filesystem read/write
echo "############## HERE 1 ########################" > /dev/kmsg
losetup > /dev/kmsg
mount -t tmpfs -o remount,mode=755,rw,nosuid,nodev,size="16500M",nr_inodes=819200,inode64 tmpfs /run
echo "TEST Unpacking live filesystem (may take some time)" > /dev/kmsg
mkdir -m 0755 -p /run/initramfs/fsimg/
if [ -n "$SQUASHED" ]; then
cp -v $FSIMG /run/initramfs/fsimg/rootfs.img
else
echo "############## HERE 2 ########################" > /dev/kmsg
unpack_archive $FSIMG /run/initramfs/fsimg/
fi
FSIMG=/run/initramfs/fsimg/rootfs.img
fi
# For writable DM images...
readonly_base=1
if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] \
|| [ -n "$writable_fsimg" ] \
|| [ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then
if [ -z "$readonly_overlay" ]; then
unset readonly_base
setup=rw
else
setup=yes
fi
fi
if [ "$FSIMG" = "$SQUASHED" ]; then
BASE_LOOPDEV=$SQUASHED_LOOPDEV
else
echo "############## HERE 3 ########################" > /dev/kmsg
BASE_LOOPDEV=$(losetup -f --show ${readonly_base:+-r} $FSIMG)
echo "$BASE_LOOPDEV" > /dev/kmsg
sz=$(blockdev --getsz "$BASE_LOOPDEV")
fi
if [ "$setup" = rw ]; then
echo "############## HERE 4 ########################" > /dev/kmsg
echo 0 "$sz" linear "$BASE_LOOPDEV" 0 | dmsetup create live-rw
else
# Add a DM snapshot or OverlayFS for writes.
do_live_overlay
fi
fi
if [ -n "$reloadsysrootmountunit" ]; then
eval "$reloadsysrootmountunit"
systemctl daemon-reload
fi
ROOTFLAGS="$(getarg rootflags)"
if [ "$overlayfs" = required ]; then
echo "rd.live.overlay.overlayfs=1" > /etc/cmdline.d/dmsquash-need-overlay.conf
fi
if [ -n "$overlayfs" ]; then
if [ -n "$FSIMG" ]; then
mkdir -m 0755 -p /run/rootfsbase
echo "#/run/initramfs/fsimg/... HERE 5 ###################" > /dev/kmsg
echo "FSIMG var: mount -r $FSIMG /run/rootfsbase" > /dev/kmsg
echo "############## HERE 5 ###################" > /dev/kmsg
mount -r $FSIMG /run/rootfsbase
else
ln -sf /run/initramfs/live /run/rootfsbase
fi
else
if [ -z "$DRACUT_SYSTEMD" ]; then
[ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS"
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh
fi
fi
[ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs
ln -s null /dev/root
need_shutdown
exit 0
Distribution used
Fedora 41
Dracut version
dracut-103-3.fc41.x86_64
Init system
systemd
To Reproduce
Use a computer with enough RAM and use the rd.writable.fsimg=1 boot parameter in grub config.
Even in a VM with less RAM, the fail still happens, the test machine does not need 32 GB of RAM.
Expected behavior
Same as F40, mount not failing, image is copied and boot continues as usual.