Package: dracut-core
Version: 106-6
Severity: important
X-Debbugs-Cc: [email protected], [email protected]

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


-- System Information:
Debian Release: 13.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable'), (100, 'trixie-fasttrack'), (100, 'trixie-backports-staging')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.57+deb13-amd64 (SMP w/2 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE, TAINT_LIVEPATCH
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dracut-core depends on:
ii  cpio            2.15+dfsg-2
ii  dracut-install  106-6
ii  e2fsprogs       1.47.2-3+b3
ii  kmod            34.2-2
ii  libc6           2.41-12
ii  udev            257.9-1~deb13u1

Versions of packages dracut-core recommends:
ii  binutils            2.44-3
ii  console-setup       1.242~deb13u1
ii  cryptsetup          2:2.7.5-2
ii  dmsetup             2:1.02.205-2
pn  kpartx              <none>
ii  lvm2                2.03.31-2
pn  mdadm               <none>
ii  systemd             257.9-1~deb13u1
ii  systemd-cryptsetup  257.9-1~deb13u1
ii  systemd-sysv        257.9-1~deb13u1
ii  zstd                1.5.7+dfsg-1

dracut-core suggests no packages.

-- no debconf information

Attachment: pgpQSTsg_wo7g.pgp
Description: OpenPGP digital signature

Reply via email to