BTRFS Snapshots (snapper)
Fedora BTRFS Snapshots
Section titled “Fedora BTRFS Snapshots”Runs through process of setting system backs with BTRFS formated drive on fedora
Create Snapshot Locations
Section titled “Create Snapshot Locations”sudo snapper -c root create-config /
sudo snapper -c home create-config /home
Verify
Section titled “Verify”sudo snapper list-configsConfig │ Subvolume───────┼──────────home │ /homeroot │ /Setup snapshots before/after every update
Section titled “Setup snapshots before/after every update”sudo dnf install python3-dnf-plugin-snapper
List all snap shots
Section titled “List all snap shots”sudo snapper -c root list
sudo snapper -c home list
Create snapshot
Section titled “Create snapshot”sudo snapper -c root create --description "Before fedora 44 upgrade"
sudo snapper -c home create --description "Before fedora 44 upgrade"
Remove snapshot
Section titled “Remove snapshot”use list command to find <num>
sudo snapper -c root delete <num>
sudo snapper -c home delete <num>
Btrfs Assistant(GUI)
Section titled “Btrfs Assistant(GUI)”The GUI application for managing snapshots on fedora.
launch via cli
Section titled “launch via cli”sudo btrfs-assistant
Create snapshot
Section titled “Create snapshot”- navigate to snapper
- select snapshot location (snapshot config)
- press “new” to manually create a snapshot
Excluding directories from snapshot
Section titled “Excluding directories from snapshot”snapshots cost near zero intially and only gor in size as files are changed. If home is 60G and 500MB worth of changes happen the snapshot only uses 500MB. You may want to exclude directories that do not change often
mv ~/.cache ~/.cache-oldbtrfs subvolume create ~/.cachecp -a ~/.cache-old/. ~/.cache/rm -rf ~/.cache-oldrm -rf ~/.local/share/Trashbtrfs subvolume create ~/.local/share/TrashDownloads
Section titled “Downloads”mv ~/Downloads ~/Downloads-oldbtrfs subvolume create ~/Downloadscp -a ~/Downloads-old/. ~/Downloadsrm -rf ~/Downloads-oldkillall -9 steammv ~/.local/share/Steam ~/.local/share/Steam-oldbtrfs subvolume create ~/.local/share/Steamcp -a ~/.local/share/Steam-old/. ~/.local/share/Steam/rm -rf ~/.local/share/Steam-oldflatpak
Section titled “flatpak” mv ~/.local/share/flatpak ~/.local/share/flatpak-old btrfs subvolume create ~/.local/share/flatpak cp -a ~/.local/share/flatpak-old/. ~/.local/share/flatpak/ rm -rf ~/.local/share/flatpak-old