Skip to content

snapper-support

snapper-support is the package that sets up Snapper snapshots of the root filesystem on Garuda Linux. Its description reads Support package for enabling Snapper with snap-pac and grub-btrfs. It has no window and no command of its own. All its work happens in the install script and in two systemd units.

To restore a snapshot, use Snapper Tools or follow Restoring snapshots.

ItemValue
Packagesnapper-support, version 1.1.2 release 4, from pkgbuilds/snapper-support.
Dependssnapper, snap-pac, grub-btrfs
Conflictstimeshift-support, timeshift, timeshift-autosnap
ISOListed in the Snapshot section of Packages-Desktop-Common, together with snapper-tools and btrfs-assistant.
PathContent
/etc/snapper/config-templates/garudaThe Garuda Snapper template. See Snapper config template.
/usr/lib/systemd/system/grub-btrfs-snapper.pathWatches /.snapshots for changes (PathModified=/.snapshots).
/usr/lib/systemd/system/grub-btrfs-snapper.serviceRebuilds the snapshot entries of the GRUB menu.

On install, snapper-support.install runs these steps in order.

StepAction
1If /etc/lsb-release does not exist, it sets GRUB_BTRFS_SUBMENUNAME in /etc/default/grub-btrfs/config to the NAME from /etc/os-release followed by snapshots. If /etc/lsb-release exists, the default submenu name stays.
2If grub-btrfs.path is enabled, it disables and stops it.
3It enables and starts grub-btrfs-snapper.path and snapper-cleanup.timer. The line for snapper-timeline.timer is commented out, so that timer is not enabled.
4It creates the Snapper configuration for / from the template: snapper create-config --template garuda /.
5If /etc/mkinitcpio.conf exists and its HOOKS= line has no grub-btrfs-overlayfs, it adds that hook.

On removal, the script deletes the Snapper configuration with snapper delete-config, removes grub-btrfs-overlayfs from HOOKS= again, and disables grub-btrfs-snapper.path and snapper-cleanup.timer.

grub-btrfs-snapper.path starts grub-btrfs-snapper.service whenever /.snapshots changes. It replaces the grub-btrfs.path unit of grub-btrfs, which step 2 of the install script disables.

The service loads /etc/default/grub-btrfs/config and then does the following.

SituationAction
/ is mounted from a path that contains .snapshotsNothing. The menu is not rebuilt during a snapshot boot.
grub-btrfs.cfg in the GRUB folder exists and is not emptyRuns /etc/grub.d/41_snapshots-btrfs to rebuild only the snapshot entries.
OtherwiseRuns grub-mkconfig -o <GRUB folder>/grub.cfg to rebuild the whole menu.

The GRUB folder is GRUB_BTRFS_GRUB_DIRNAME from the grub-btrfs config, /boot/grub by default. The grub-mkconfig command can be changed with GRUB_BTRFS_MKCONFIG.

/etc/snapper/config-templates/garuda holds these values. The install script copies them into the configuration of /.

KeyValueMeaning
SUBVOLUME/Subvolume to snapshot
FSTYPEbtrfsFilesystem type
QGROUPemptyBtrfs qgroup for space aware cleanup
SPACE_LIMIT0.5Share of the filesystem that snapshots may use
FREE_LIMIT0.2Share of the filesystem that should stay free
ALLOW_USERS, ALLOW_GROUPSemptyUsers and groups allowed to work with the config
SYNC_ACLnoDo not sync these users and groups to .snapshots
BACKGROUND_COMPARISONyesCompare pre and post snapshots in the background
NUMBER_CLEANUPyesRun the daily number cleanup
NUMBER_MIN_AGE1800Minimum age in seconds before number cleanup removes a snapshot
NUMBER_LIMIT10Snapshots kept by number cleanup
NUMBER_LIMIT_IMPORTANT5Important snapshots kept by number cleanup
TIMELINE_CREATEnoNo hourly snapshots
TIMELINE_CLEANUPyesClean up timeline snapshots
TIMELINE_MIN_AGE1800Minimum age in seconds before timeline cleanup removes a snapshot
TIMELINE_LIMIT_HOURLY5Hourly snapshots kept
TIMELINE_LIMIT_DAILY7Daily snapshots kept
TIMELINE_LIMIT_WEEKLY, TIMELINE_LIMIT_MONTHLY, TIMELINE_LIMIT_YEARLY0No weekly, monthly or yearly snapshots kept
EMPTY_PRE_POST_CLEANUPyesRemove pre and post pairs without changes
EMPTY_PRE_POST_MIN_AGE1800Minimum age in seconds for that cleanup

Snapper Tools can change TIMELINE_CREATE, the timeline limits and NUMBER_LIMIT later. It labels NUMBER_LIMIT as Pacman Settings.

snapper-support ships no pacman hook of its own. The snapshots before and after package changes come from its dependency snap-pac. Two hooks of garuda-hooks work with the snapshot setup.

HookPackageEffect
01-snapshot-reject.hookgaruda-hooksAborts any pacman transaction while the system is booted into a snapshot. Set GARUDA_SNAPSHOT_PACMAN=1 to bypass it.
grub-btrfs-config.hookgaruda-hooksAfter grub-btrfs is installed or upgraded, adds a line to /etc/default/grub-btrfs/config that loads drop-in files from /etc/default/grub-btrfs/config.d/*.cfg.

Garuda Linux used Timeshift for snapshots before it switched to Snapper. The changelog of that switch describes snapper-support as the package to transition to Snapper easily on older installations.

snapper-support conflicts with timeshift, timeshift-autosnap and timeshift-support. pacman therefore asks to remove them when you install it. The timeshift-support package itself was dropped. The changelog 260819 lists Drop under timeshift-support.

garuda-health checks the setup of this package.

MessageLevelFix
Snapper (automatic btrfs system restore) is not installed and configuredINFOInstall snapper-support
Snapper (automatic btrfs system restore) is not using the official Garuda Linux configurationINFOInstall snapper-support. Shown when snapper is installed without snapper-support.
Snapper cleanup timer is not enabledLOWEnable snapper-cleanup.timer
Snapper configuration for root is missingHIGHgaruda-update remote reset-snapper
Snapper snapshots directory is missingHIGHgaruda-update remote reset-snapper

The help of garuda-update describes reset-snapper as Remove all backup subvolumes and snapshots created by Snapper, and force recreates Snapper configs.