Skip to Content
MvpDots

Snapshots you can boot into

If an update breaks the system, pick an older snapshot in the boot menu and you are back.

  • snapper manages the snapshots of / (config root).
  • snap-pac takes a snapshot before and after every pacman transaction, automatically.
  • grub-btrfs + grub-btrfsd add every snapshot to the GRUB menu, so you can boot into one.

Keep it small

# /etc/snapper/configs/root (only the changed lines)
NUMBER_LIMIT="8"
TIMELINE_LIMIT_HOURLY="0"
TIMELINE_LIMIT_DAILY="5"
TIMELINE_LIMIT_WEEKLY="0"
TIMELINE_LIMIT_MONTHLY="0"
TIMELINE_LIMIT_YEARLY="0"
sudo systemctl enable --now snapper-timeline.timer snapper-cleanup.timer grub-btrfsd

Make one permanent snapshot once the system works, and give it a name:

sudo snapper -c root create --description "foundation" --cleanup-algorithm ""

Before any bigger change, take one by hand: sudo snapper -c root create --description "<what you are about to do>".

Keep big, rebuildable data out of snapshots

Anything that lives inside @ is pinned by every snapshot until the snapshot is deleted. Container images are the classic trap: a 30 GB build cache stays on disk for weeks. Give such data its own subvolume, or move it off the drive (see Docker on the shared drive).

Let a normal user see snapshots

ALLOW_USERS="<you>" in the snapper config lets the desktop's Time Machine page list snapshots and make new ones without sudo.

Before and after

/etc/snapper/configs/root
-NUMBER_LIMIT="50"
+NUMBER_LIMIT="8"
-TIMELINE_LIMIT_HOURLY="10"
+TIMELINE_LIMIT_HOURLY="0"
-TIMELINE_LIMIT_DAILY="10"
+TIMELINE_LIMIT_DAILY="5"
-TIMELINE_LIMIT_MONTHLY="10"
+TIMELINE_LIMIT_MONTHLY="0"
-TIMELINE_LIMIT_YEARLY="10"
+TIMELINE_LIMIT_YEARLY="0"
+ALLOW_USERS="<you>"

Check it

Terminal
snapper -c root list | tail -5      # snapshots, newest last
systemctl status grub-btrfsd        # keeps the GRUB menu in sync

Result: every pacman transaction leaves a before/after pair, and the GRUB menu has a snapshots entry.

On this page