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
/(configroot). - snap-pac takes a snapshot before and after every
pacmantransaction, automatically. - grub-btrfs +
grub-btrfsdadd 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-btrfsdMake 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
-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
snapper -c root list | tail -5 # snapshots, newest last
systemctl status grub-btrfsd # keeps the GRUB menu in syncResult: every pacman transaction leaves a before/after pair, and the GRUB menu has a snapshots entry.
Disk layout
One Linux partition, formatted as Btrfs, split into subvolumes. A subvolume behaves like its own filesystem (it can be snapshotted on its own), but every subvolume shares the free space of the partition.
Memory
16 GB fills up quickly with a browser, an editor and containers. Instead of freezing, the system should compress what is idle, and if memory really runs out, close the hungriest app, not the whole desktop.