Recently I've been messing with the following minimal modifications to
see what happens:
; mount the top level of the fs
mount /dev/sdXY /mnt
cd /mnt
; make a snapshot
btrfs sub snap -r root root.rescue
; modify the rescue boot entry
nano /boot/loader/entries/$(cat /etc/machine-id)-0-rescue.conf
rootflags=subvol=root.rescue fstab=no systemd.volatile=overlay
Now systemd will mount the root.rescue snapshot, and it will ignore
fstab so nothing else with your system is being mounted, and you'll
get a normal read-write behaving environment with volatile changes. If
you reboot, the changes are all lost. It's a pretty rudimentary
starting point because of all the gotchas I mentioned previously. But
it's a lot better than the dracut shell.
Also, today's rescue boot entry has variable behavior depending on the
age of the system. Initially, it'll boot straight to GDM on its own.
But once a 3rd kernel is installed, and the original kernel package is
removed, the matching /usr/lib/modules/$kernelversion also goes away.
Interestingly, due to:
* vfat is not baked into the kernel itself
* vfat is in the initramfs
* switch root happens before mount /boot/efi
* upon switch root the initramfs and thus vfat module is unavailable
* /usr/lib/modules/$kernelversion is gone
* /etc/fstab for /boot/efi doesn't include nofail or noauto
Now /boot/efi can't mount because vfat.ko isn't available, and
therefore we get dropped to a dracut shell instead of graphical boot.
So we actually could just try to figure out how to get the rescue
entry to get us to graphical boot. Maybe by adding nofail to
/boot/efi? Or another idea?
If the initial root -> root.rescue snapshot is created by the
installer, this will pin this initially installed kernel's kernel
modules. The package gets deleted from "root" subvolume but not the
"root.rescue" snapshot. So it ends up not having this problem. The
simplest fix might be good enough. But I admit that I like the idea of
root.rescue being used as a quick way of doing a clean install /
reset. And I also like the volatile overlay with a read-only root.
Chris Murphy