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.
Package
Section titled “Package”| Item | Value |
|---|---|
| Package | snapper-support, version 1.1.2 release 4, from pkgbuilds/snapper-support. |
| Depends | snapper, snap-pac, grub-btrfs |
| Conflicts | timeshift-support, timeshift, timeshift-autosnap |
| ISO | Listed in the Snapshot section of Packages-Desktop-Common, together with snapper-tools and btrfs-assistant. |
Installed files
Section titled “Installed files”| Path | Content |
|---|---|
/etc/snapper/config-templates/garuda | The Garuda Snapper template. See Snapper config template. |
/usr/lib/systemd/system/grub-btrfs-snapper.path | Watches /.snapshots for changes (PathModified=/.snapshots). |
/usr/lib/systemd/system/grub-btrfs-snapper.service | Rebuilds the snapshot entries of the GRUB menu. |
What the install script does
Section titled “What the install script does”On install, snapper-support.install runs these steps in order.
| Step | Action |
|---|---|
| 1 | If /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. |
| 2 | If grub-btrfs.path is enabled, it disables and stops it. |
| 3 | It 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. |
| 4 | It creates the Snapper configuration for / from the template: snapper create-config --template garuda /. |
| 5 | If /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 snapshot entries
Section titled “GRUB snapshot entries”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.
| Situation | Action |
|---|---|
/ is mounted from a path that contains .snapshots | Nothing. The menu is not rebuilt during a snapshot boot. |
grub-btrfs.cfg in the GRUB folder exists and is not empty | Runs /etc/grub.d/41_snapshots-btrfs to rebuild only the snapshot entries. |
| Otherwise | Runs 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.
Snapper config template
Section titled “Snapper config template”/etc/snapper/config-templates/garuda holds these values. The install script copies them into the configuration of /.
| Key | Value | Meaning |
|---|---|---|
SUBVOLUME | / | Subvolume to snapshot |
FSTYPE | btrfs | Filesystem type |
QGROUP | empty | Btrfs qgroup for space aware cleanup |
SPACE_LIMIT | 0.5 | Share of the filesystem that snapshots may use |
FREE_LIMIT | 0.2 | Share of the filesystem that should stay free |
ALLOW_USERS, ALLOW_GROUPS | empty | Users and groups allowed to work with the config |
SYNC_ACL | no | Do not sync these users and groups to .snapshots |
BACKGROUND_COMPARISON | yes | Compare pre and post snapshots in the background |
NUMBER_CLEANUP | yes | Run the daily number cleanup |
NUMBER_MIN_AGE | 1800 | Minimum age in seconds before number cleanup removes a snapshot |
NUMBER_LIMIT | 10 | Snapshots kept by number cleanup |
NUMBER_LIMIT_IMPORTANT | 5 | Important snapshots kept by number cleanup |
TIMELINE_CREATE | no | No hourly snapshots |
TIMELINE_CLEANUP | yes | Clean up timeline snapshots |
TIMELINE_MIN_AGE | 1800 | Minimum age in seconds before timeline cleanup removes a snapshot |
TIMELINE_LIMIT_HOURLY | 5 | Hourly snapshots kept |
TIMELINE_LIMIT_DAILY | 7 | Daily snapshots kept |
TIMELINE_LIMIT_WEEKLY, TIMELINE_LIMIT_MONTHLY, TIMELINE_LIMIT_YEARLY | 0 | No weekly, monthly or yearly snapshots kept |
EMPTY_PRE_POST_CLEANUP | yes | Remove pre and post pairs without changes |
EMPTY_PRE_POST_MIN_AGE | 1800 | Minimum 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.
Pacman hooks
Section titled “Pacman hooks”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.
| Hook | Package | Effect |
|---|---|---|
01-snapshot-reject.hook | garuda-hooks | Aborts any pacman transaction while the system is booted into a snapshot. Set GARUDA_SNAPSHOT_PACMAN=1 to bypass it. |
grub-btrfs-config.hook | garuda-hooks | After 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. |
Timeshift
Section titled “Timeshift”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.
Checks in garuda-health
Section titled “Checks in garuda-health”garuda-health checks the setup of this package.
| Message | Level | Fix |
|---|---|---|
Snapper (automatic btrfs system restore) is not installed and configured | INFO | Install snapper-support |
Snapper (automatic btrfs system restore) is not using the official Garuda Linux configuration | INFO | Install snapper-support. Shown when snapper is installed without snapper-support. |
Snapper cleanup timer is not enabled | LOW | Enable snapper-cleanup.timer |
Snapper configuration for root is missing | HIGH | garuda-update remote reset-snapper |
Snapper snapshots directory is missing | HIGH | garuda-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.
Related pages
Section titled “Related pages”- Snapper Tools creates, deletes and restores the snapshots.
- Restoring snapshots explains how to boot a snapshot from GRUB and restore it.
- Garuda Health reports a missing or broken Snapper setup.
- The Arch Wiki pages Snapper, Btrfs, GRUB and Timeshift cover the tools in more depth.