Ramblings of an aging IT geek
← Ramblings of an aging IT geek
linux

the rollback that turned a disaster into a footnote

A bad package upgrade left my workstation unbootable, and a btrfs snapshot put it back in under a minute.

A Linux terminal showing a btrfs subvolume list

I broke my own machine on Friday evening, which is the correct time to break a machine because there is a whole weekend to feel smug about fixing it. A routine upgrade pulled in a kernel and a graphics stack that did not agree with each other, and the next boot dropped me to a black screen and a blinking cursor. Old me would have spent the evening with a live USB and a sinking feeling.

New me has snapper taking automatic snapshots before and after every package transaction. So from the boot menu I picked the read-only snapshot from before the upgrade, booted into it, confirmed it was fine, and rolled the system subvolume back to that state.

snapper list
snapper rollback 142

Reboot, and I was back exactly where I'd been an hour earlier, packages and all. The whole recovery took less time than writing this paragraph. The clever part of btrfs here isn't the filesystem being trendy, it's that a snapshot is just another subvolume, so rolling back is a metadata operation rather than a restore from somewhere slow. I lost nothing, learned which two packages to pin until upstream sorted it out, and got my weekend back. Set up the automatic snapshots before you need them, not after.