I use Dracut's `rd.live.overlay.overlayfs` feature to boot my system in
"live mode" occasionally, so that any changes I make to the system while
booted in this way end up being discarded on reboot. With ext4 this
works, however with BTRFS it does not work. The overlay is never
mounted. On a clean Debian installation, the filesystem is left
read-write, while on my "normal" machine, the filesystem ends up
read-only and lots of things break. This appears to have been fixed some
time ago upstream (see [1]), and the fix is in Forky already, but it
would be very helpful if the fix for this could end up in trixie or
trixie-backports.
To reproduce the issue:
1. Install Trixie into a virtual machine with the netinstaller, using
the "All files in one partition" option, and setting the filesystem
of the main partition to BTRFS during the installation process.
2. Boot into the installed system, and run
`sudo apt install dracut dracut-live`.
3. Reboot and verify the system still works normally.
4. Run
`sudo dracut --force --regenerate-all --add systemd --add dmsquash-live --force`
to create initramfs images that include the needed modules for
`rd.live.overlay.overlayfs=1` to work.
5. Reboot again, but once at the GRUB menu, press `e`, move the cursor
down to the line that starts with `linux`, and append
`rd.live.overlay.overlayfs=1 rd.debug rd.break` to the kernel command
line. Then press Ctrl+X to boot.
6. When prompted "Cannot open access to console, the root account is
locked", press Enter to continue boot.
7. Run `mount | LC_ALL='C' grep ' on / '`, and verify that you are shown
that the root filesystem is mounted 'rw' and there is no overlayfs
mounted on `/`.
8. Run `nano /run/initramfs/rdsosreport.txt`, then press Ctrl+W and
search for `fsconfig`. You should be taken to an error message from
`dracut-pre-pivot` that reads:
mount: /sysroot: fsconfig() failed: overlay: Unknown parameter 'subvol'.
dmesg(1) may have more information after failed mount system call.
What I expect to happen in step 7, and what actually does happen if I
manually apply the fix from upstream to
`/usr/lib/dracut/modules.d/90overlayfs/mount-overlayfs.sh`, is that the
root filesystem mount line in step 7 should look like
`LiveOS_rootfs on / type overlay (rw,relatime,lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork,uuid=on)`.
Then in step 8, the string "fsconfig" shouldn't occur in
`rdsosreport.txt` at all.
[1] https://github.com/dracut-ng/dracut-ng/commit/deeb670c28d12a478bbea95e29677e436d1912fb