Omarchy

How-To: Take and Compare Btrfs Snapshots With snapper Before a Big Update

Leave a comment

With Omarchy 4.6.0 out, a lot of us are about to run a big update. Before I do anything major on a Btrfs machine, I take a snapshot I can compare against, or roll files back from. Here’s the quick version with snapper.

1. Make sure you have a root config

sudo snapper list-configs
sudo snapper -c root list

If there’s no root config, the Arch Wiki’s Snapper page walks through creating one. Don’t let it fight with an existing snapshot tool.

2. Snapshot before

sudo snapper -c root create -t single -d "before big update" --print-number

Write down the number it prints, say 42.

3. Update, then snapshot after

sudo snapper -c root create -t single -d "after big update" --print-number

4. See what changed

sudo snapper -c root status 42..43 | less
sudo snapper -c root diff 42..43 /etc/pacman.conf

status lists every file added (+), deleted (-) or changed (c). diff shows the exact changes in a file.

5. Undo just one file

sudo snapper -c root undochange 42..43 /etc/some.conf

That reverts the file without touching anything else. For a full rollback, boot the older snapshot from your boot menu if your setup supports it, then follow your distro’s rollback steps.

6. Clean up

sudo snapper -c root delete 42-43

Omarchy note: the new guided Secure Boot wizard warns that snapshots taken before the bootloader switch finishes are deleted. Don’t count on a pre-switch snapshot as your safety net for that one. Back up your files somewhere else first.

God Bless, and Happy hacking!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.