Btrfs snapshot booting

I’ve been test driving btrfs since 12.1 and have been generally happy with it, I like the ZFS-esque features, particularly snapshots, and am looking forward to trying out some of the new RAID levels, and using subvol snapshots for LXC containers, etc. I don’t personally like snapper much, and prefer to manage snapshots directly. While I know you can roll back with snapper, it does so via rsync like copies between the current and prior snapshots. Generally, if I want to roll back I want to roll everything back and simply boot to a subvolume - which unfortunately has never worked for me. I’d hoped this would work in 12.3, but it seems not.

I’ve tried creating a snapshot and then using

subvolume set-default 268 /

And rebooting, which hangs at various places during the boot process.

I’ve also tried using kernel boot argument like:

rootflags=subvolid=268

with the same result: just hangs at starting various services, or init never even runs, etc.

Does anyone have suggestions on how to be able to boot to a subvolume ID? From the reading I’ve done it seems this does in fact work on various other distros, though each tends to have some implementation variations.

Thank you,
Lews Therin

Although I can’t help your Q,

I thought I might bring to your attention the brand new systemd support for various types of snapshots. Isn’t in the current 12.2, should be in 12.3

Haven’t personally implemented, but should be according to the installed version of systemd.

TSU

Could you explain in some more details? I am not sure I understand how systemd is related to snapshots.

systemd now has a Unit that is dedicated to creating and restoring snapshots of <state>.

The authors of systemd haven’t posted any real world examples using this I’m aware of, but a clue is embedded in this blog post
Wunschkonzert, Ponyhof und Abenteuerspielplatz

The description suggests snapshot is intended more for preservation and recovery of running Unit states, but given the flexibility of the architecture might be applied to many purposes.

So, this isn’t quite the same as a filesystem snapshot, but I’m speculating for instance if an Unit continuously runs and monitors something else (like a filesystem), then shapshotting might be useful to periodically take snapshots of the monitoring state and by extension what the app is monitoring like a filesystem…

Just speculating, a lot of this systemd stuff is very new and not fully documented but very intriguing.

TSU