I've been trying to set up a BTRFS system with snapshots similar to the layout that OpenSUSE has, and encountered somewhat of a roadblock. My current subvolume layout is nearly identical to OpenSUSE's, with @var
being a separate subvolume (so anything in /var/
is not snapshotted).
However, this has led to some difficulties such as uninstalled packages showing as installed after reverting to a pre-installation snapshot (despite the files no longer being on the system). I assume this is due to /var/lib/pacman
being excluded from snapshots.
Another issue I had was installed packages not present in the installed and local repo databases after reverting to a pre-uninstallation snapshot, leading to the package being present on my system but not showing in pacman -Qs <package>
nor pacman -Ss <package>
(searching the local repo). The only way I could uninstall said package was to reinstall it forcefully, using the --overwrite
flag in pacman, and then uninstalling it.
For reference, the local repository and its .db file that I use to contain my AUR packages is located at /var/cache/pacman/aur-local
, alongside the pacman /pkg
cache directory, where pacman packages go in /pkg
and my built AUR packages go in /aur-local
. My cloned PKGBUILDs go into ~/.cache
. With my current setup where the entirety of /var
is a subvolume, this is excluded from snapshots.
I've seen some example layouts in the Arch wiki and forums, with some citing to make subvolumes for /var/cache
, /var/log
, /var/spool
, /var/tmp
, and /var/machines
. Does anyone know what layout is most recommended (in regards to /var
) to prevent the issues I described above?