Skip to content

Snapshot Rollback

You'll set up a root filesystem that keeps a frozen copy of itself before every update, then break an update on purpose and put the whole system back in one reboot.

About

A snapshot is a frozen copy of the filesystem that costs almost no space and takes a second to make, and once your root has them, a bad update stops being a lost Sunday. Btrfs with snapper or Timeshift is the common route, ZFS and LVM thin volumes also work, and openSUSE and Fedora ship most of it ready. The badge needs a machine you can reinstall, because the filesystem choice is made at install time. The trap is thinking snapshots are backups, and they are not: they live on the same disk, so when it dies they die with it. A hypervisor's snapshot button is in Homelab & Hardware, and this badge is about the filesystem under a real install.

At a glance

Per requirement
35 XP
Completion bonus
300 XP
Requirements
6
Takes
Two weekends
Skill level
Advanced (years of practice)
Cost
Cheap (under $10)
Supplies
You need some
Where
At home
Other people
On your own
Locked for now
Earn two more Uncommon badges in Linux to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Install or convert a system onto a filesystem that supports snapshots, with separate subvolumes for root and home. On a fresh install pick Btrfs and the installer's subvolume layout, or set @ and @home up by hand. Keeping home out of the root snapshot means a rollback doesn't eat your documents. Take a photo of the subvolume list and findmnt showing them mounted. Photo
  2. 2
    Take a manual snapshot, change something, and read the difference. Snapshot root, then install a package or edit a file in /etc, and use the snapshot tool's diff or status to see exactly what changed between the two. Take a photo of the diff output. Photo
  3. 3
    Hook snapshots into the package manager so every update makes one. snapper with the apt, dnf or pacman hook, or Timeshift with its own scheduler. Run an update and show the pre and post snapshots it made on its own. Take a photo of the snapshot list with the automatic pair. Photo
  4. 4
    Break the system on purpose and roll back. Remove something important, like the desktop environment package or part of the graphics stack, or install a broken kernel, so that it no longer boots to a desktop. Then roll back to the pre-update snapshot, either from the bootloader's snapshot menu or by setting the default subvolume, and reboot. Film the broken boot and the recovered desktop. Video
  5. 5
    Set a cleanup rule and show it pruning. Snapshots pile up, and a timeline with no cleanup fills the disk. Set a limit by number or by age, then make more snapshots than the limit allows and show the oldest ones gone. Take a photo of the snapshot list after the prune with the limit from your config beside it. Photo
  6. 6
    Send a snapshot to another disk so it counts as a backup. Use btrfs send and receive, or zfs send, to an external drive, then mount the copy and read a file from it. Now the snapshot survives the disk. Take a photo of the file open from the external copy. Photo