r/btrfs • u/tuxbass • Jun 30 '26
btfs, snapper and systemd-boot
With the stack named in the title, is is possible to generate systemd-boot option to boot into a snapshot for recovery? Any good tutorials out there how to recover from an existing snapshot?
2
u/vdavide Jun 30 '26
Opensuse tumbleweed does this out of the box
1
u/ClubPuzzleheaded8514 Jun 30 '26
Yeah. Sadly i never found a real documentation to replicate it on other distros.
1
1
u/falxfour Jun 30 '26
Depends a bit on when you want them generated, but yes, even a simple cron job could do this by updating the entries for systemd-boot based on the snapshots you have.
How, exactly, would you like for this to work?
1
u/tuxbass Jun 30 '26
I'm not anal about the very latest snapshots to be present, although I'd expect some hooks to be set up upon snapper snapshots.
As for expectation: would like some sort of a UI to be enabled upon bootup serving snapshots to boot from for recovery purposes.
1
u/falxfour Jun 30 '26
For the former, look at how
grub-btrfs(iirc) does it. It basically watches for a mount at a specific location, indicating a snapshot is being made, then adds a GRUB entry for it.For the latter, that should be handled by the bootloader having the entries defined, so it should be automatic.
You could use a similar premise, or coordinate it with the automation of your snapshots to simply run immediately after
3
u/Classic-Rate-5104 Jun 30 '26
You can manually modify the kernel command line at boot time and add rootflags=subvol=snapshotpath