LinuxCommandLibrary

snapper

Filesystem snapshot management for Btrfs

TLDR

List snapshot configurations

$ snapper list-configs
copy
Create a configuration
$ snapper -c [config] create-config [path/to/directory]
copy
Create a snapshot with description
$ snapper -c [config] create -d "[description]"
copy
List snapshots for a config
$ snapper -c [config] list
copy
Delete a snapshot
$ snapper -c [config] delete [snapshot_number]
copy
Delete a range of snapshots
$ snapper -c [config] delete [snapshot1]-[snapshot2]
copy
Show differences between snapshots
$ snapper -c [config] status [snapshot1]..[snapshot2]
copy
Rollback to a snapshot
$ snapper -c [config] rollback [snapshot_number]
copy

SYNOPSIS

snapper [-c config] command [OPTIONS]

DESCRIPTION

snapper is a filesystem snapshot management tool primarily used with Btrfs. It creates, compares, and manages snapshots, enabling system rollback and file recovery. Snapper supports automatic snapshot timelines with configurable retention policies.
Each configuration manages snapshots for a specific subvolume or logical volume. Snapshots can be created manually or automatically before/after system changes. The cleanup algorithms automatically remove old snapshots based on age or count limits.

PARAMETERS

-c, --config name

Use specified configuration
list-configs
List all configurations
create-config path
Create new configuration for subvolume
delete-config
Delete a configuration
create
Create a new snapshot
delete number
Delete snapshot(s)
list
List snapshots
status num1..num2
Show changes between snapshots
diff num1..num2
Show file differences
undochange num1..num2 files
Undo changes between snapshots
rollback [number]
Rollback system to snapshot
cleanup algorithm
Run cleanup algorithm (number, timeline, empty-pre-post)
setup-quota
Set up quota (btrfs only)
-d, --description text
Snapshot description
-t, --type type
Snapshot type (single, pre, post)
-u, --userdata key=value
Set snapshot metadata
-s, --sync
Sync filesystem after delete

CONFIGURATION

/etc/snapper/configs/

Per-subvolume configuration files defining snapshot types, cleanup algorithms, and retention policies (timeline and number limits).
/etc/sysconfig/snapper
Global snapper settings including the list of active configurations (SNAPPER_CONFIGS).

CAVEATS

Rollback is only supported on Btrfs with proper system configuration. Snapshots consume disk space; monitor usage with btrfs filesystem df. Non-root users need configuration permissions set via ALLOW_USERS. The /.snapshots directory must have correct permissions.

HISTORY

snapper was created by Arvin Schnell at openSUSE/SUSE and first released around 2011. It was designed to leverage Btrfs snapshot capabilities for system recovery and became a key component of openSUSE and SUSE Linux Enterprise. Support for thin-provisioned LVM was added later.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community