← Writing

Linux · Btrfs

An un-brickable Linux with Btrfs

A rolling-release system that's always current sounds scary until you have an undo button. Btrfs snapshots give you exactly that — roll a bad update back in seconds, and back up so the machine is never truly beyond repair.

The idea in one sentence

Btrfs can take a photograph of your entire system in a fraction of a second, and let you step back into that photograph later — so a broken update, a bad config, or a "what did I just delete" moment becomes a thirty-second fix instead of a reinstall.

That safety net is what makes running something bleeding-edge likeArchgenuinely relaxing. You stop fearing updates.

Why Btrfs can do this (and ext4 can't)

The trick iscopy-on-write. On a normal filesystem, editing a file overwrites it in place — the old version is gone. On Btrfs, a change is written to anewlocation and the filesystem just updates its pointer. The old blocks are still there until nothing references them.

That means asnapshot— a full, frozen view of your files at a moment in time — costs almost nothing to create. It's not a copy; it's just a second set of pointers to the same blocks. Only the things that change afterwards take up new space.

Normal filesystem · overwrite in place

file → block A
↓  you edit the file
file → block A′
block A is gone forever ✕

Btrfs · copy-on-write

file → block A
↓  you edit the file
file → block A′  (new)
snapshot → block A  (kept!)
jump back to A anytime ✓

Because Btrfs never overwrites, an old snapshot keeps pointing at the original blocks — that's the whole magic.

A snapshot isn't a backup of your data — it's a bookmark in time you can return to. Instant to make, cheap to keep, and a lifesaver when an update goes sideways.

Lay it out with subvolumes

Btrfs organizes data intosubvolumes— think of them as independently-snapshottable folders. The common convention is a subvolume for the system and one for your home directory, so you can roll back the OSwithouttouching your personal files.

bash
mkfs.btrfs /dev/nvme0n1p2
bash
btrfs subvolume create /mnt/@ # system root
bash
btrfs subvolume create /mnt/@home # your files

You then mount@as/and@homeas/home. Keeping them separate is the whole reason a system rollback won't eat this afternoon's work.

Physical disk One Btrfs filesystem on the partition /dev/nvme0n1p2
↓  carved into subvolumes  ↓
@  →  mounted at / The system: OS, packages, configs. Roll this back on its own. snapshot before every update
@home  →  mounted at /home Your personal files — untouched when you roll back the system. snapshot on its own schedule
↓  snapshots stored in  ↓
.snapshots/ Frozen points in time — instant to make, sharing unchanged blocks managed by Snapper

Splitting the OS (@) from your files (@home) is what lets you undo a bad system update without losing a single document.

Snapshot before every update

You could take snapshots by hand, but the real magic is automating it.Snappermanages snapshots on a schedule and with cleanup rules; pair it with thesnap-pachook and you get a snapshot automatically takenbefore and after every package operation.

bash
snapper -c root create-config /
bash
yay -S snap-pac grub-btrfs # auto-snapshots + boot into them

Now everypacman -Syuquietly brackets itself with snapshots. If an update breaks your machine, the pre-update state is already saved — you didn't have to remember anything.

Rolling back a bad update

This is the part that turns a bricked afternoon into a shrug. Withgrub-btrfs, your bootloader lists recent snapshots as boot entries — so even if the system won't boot normally, you pick a known-good snapshot from the menu, boot into it, and restore it as the default.

bash
snapper -c root list # find the good snapshot's number
bash
snapper -c root undochange 42..0 # roll the changes back

No reinstall, no live USB, no panic. The broken state and the good state both exist side by side, and you just choose the good one.

Snapshots aren't backups — so also back up

Here's the honest caveat that a lot of tutorials skip: a snapshot lives on thesame disk. If that disk dies, your snapshots die with it. Snapshots protect you fromyou— bad updates, mistakes. They do not protect you from hardware failure.

The fix completes the picture. Btrfs can serialize a snapshot and send it to another drive — and after the first full copy, it only sends what changed, so ongoing backups are fast.

bash
btrfs send /.snapshots/1/snapshot | btrfs receive /mnt/backup
bash
btrfs send -p /.snapshots/1/snapshot /.snapshots/2/snapshot | btrfs receive /mnt/backup

That second command is the incremental one —-pmeans "only the difference since the previous snapshot." An external drive (or another machine) now holds a real, off-disk copy of your system's history.

The whole picture

Layer 1 · Automatic snapshots Snapper + snap-pac take a snapshot before & after every package operation protects you from bad updates
Layer 2 · Boot into any snapshot grub-btrfs lists snapshots in the boot menu — recover even if the system won't start protects you when it won't boot
Layer 3 · Off-disk backup btrfs send / receive copies snapshots to another drive (incrementally) protects you when the disk dies
Result: a system that's never beyond repair Bad update → roll back · won't boot → pick a snapshot · dead disk → restore bleeding edge, with an undo button

Three independent layers, each covering a different way things go wrong.

Put together, you get a system that is genuinely hard to destroy: automatic snapshots before every change mean the recent past is always one command away;grub-btrfsmeans you can reach it even when the machine won't boot; andsend/receivebackups to another disk mean that even a dead drive is a restore, not a catastrophe.

That's the state I aim for on every machine: bleeding edge, but with a time machine bolted on. You get to run the newest software in the world and still sleep at night — because the system is, for all practical purposes, never beyond repair.