Ok a setup of Snapper is sometimes tricky, even when you managed to delete his configuration.
- deinstall Snapper with pamac
- now delete all snapshots → sudo btrfs subvolume delete …
- delete subvolumes for .snapshots
- reinstall snapper
- create configurations for snapper
- snapper creates his own subvolumes for snapshots (and need to create is self) , but this configuration we dont want like snapper it does, thus
- delete subvol created by snapper for root
- create own subvol for root snapshots
- create .snapshots folder for mount points
- edit fstab to update these mountpoint
- edit snapper configurations
Attention! never…never delete Snapper’s configurations. Snapper holds on some places a hidden copy of these configurations and when you delete his /etc/snapper/configs he raises errors next time and you can’t backup these files anymore. I even had these problems, only reinstall had worked.
Now I show you my way (little bit different as in archlinux). I use snapshots for root → / and snapshots for /home. /root use only number cleanup, /home use timeline and number cleanup. I installed snap-pac and grub-btrfs to make snapshots of root and home before and after installing new packages (repository and AUR). With grub-btrfs these snapshots for root are automatically converted to GRUB2 menuentry’s to boot into these ro-Snapshots. Then i installed snap-sync to make daily backups of root and home to another BTRFS formatted backup SSD. This backup SSD contains a bootable small Manjaro Installation with GUI and all tools to recover my other Manjaro-Machines.
For booting a ro-Snapshot into GUI you have to do some more things, especially your BTRFS-Subvolume Layout.
- my BTRFS layout, all subvols named with @ at beginning
# sudo btrfs subvolume list /btrfs
ID 256 gen 34959 top level 5 path @
ID 669 gen 34965 top level 5 path @home
ID 259 gen 34964 top level 5 path @var
ID 327 gen 34411 top level 5 path @snapshots
ID 504 gen 34450 top level 327 path @snapshots/root
ID 505 gen 34943 top level 327 path @snapshots/home
I use subvol for root → / → @, home → /home → @home, /var → @var for the system. “root” and “home” are even the configuration names in snapper,snap-sync and so on.
Subvol @snapshots is a parent subvolume to hold all snapshots of root and home. Subvols @snapshots/root and @snapshots/home are subvolumes with parent @snapshots and take all snapper snapshots of root and home. That’s the difference to ArchLinux, i wanted a more cleaner layout of my subvols.
Subvolume @var mounted into /var is a special case. I mounted it with nodatacow option AND setup his folder attribute to +C. That means any folder or/and file stored in /var thus @var, are not compressed and have no copy-on-write feature set. Thus all cahces,log files an so on have no CoW and are fast accessed,writable. I take never snapshots of @var thus we can’t never boot into a ro-Snapshot of @var, and finaly any booted ro-Snapshot have rw-access of /var and can fully boot into DE (GUI).
But there is a small trap with /var. At /var/lib we have some library files that we want to include into root-Snapshots because there contains files associated to our other programs/libraries in /etc and so on. To get this managed I create a folder /usr/var/lib, copied all files from /var/lib into it, and use in FSTAB a bind-mount from /usr/var/lib to /var/lib. Thus all library configurations belongs now to @ and are snapshoted into snapshots of root.
Uff, seems realy complicated now, but it’s not realy
Before i go deeper with step by step instructions, i want to ask you what you want for information. A fast easier way to repair your snapper or my way of setup my systems.
Here my actual FSTAB.
UUID=06686a06-c069-49f7-86e4-7a962740b364 none swap rw,defaults 0 0
UUID=447C-E2BC /boot/efi vfat rw,noatime,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8 0 2
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a /btrfs btrfs rw,noatime,compress-force=zstd:5,ssd,space_cache,subvolid=5 0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a / btrfs rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@ 0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a /home btrfs rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@home 0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a /var btrfs rw,noatime,nodatacow,ssd,space_cache,subvol=@var 0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a /.snapshots btrfs rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@snapshots/root 0 0
UUID=26c8751d-2747-4a4d-b857-32c82d67b20a /home/.snapshots btrfs rw,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@snapshots/home 0 0
# var/lib mount into subvol=@
/usr/var/lib /var/lib none defaults,bind 0 0
UUID=becce8fa-cc96-466c-8e59-f2fcff75cc77 /media/Backups btrfs rw,nofail,noatime,compress-force=zstd:5,ssd,space_cache,subvol=@backups 0 0