This is a draft document that was built and uploaded automatically. It may document beta software and be incomplete or even incorrect. Use this document at your own risk.

Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
The Basic Concepts of Snapper
SUSE Linux Enterprise Server 16.1

The Basic Concepts of Snapper

Publication Date: 26 Nov 2026

Snapper is a command-line tool in SUSE Linux Enterprise Server that enables administrators to create and manage Btrfs file system snapshots. By leveraging copy-on-write capabilities, it captures the file system state with minimal disk space overhead, allowing users to safely undo system modifications, restore files and perform system rollbacks. This provides robust system recovery options while automated cleanup algorithms prevent the partition from running out of space.

Prerequisites

  • Snapper installed on the system

  • A Btrfs root partition (/) with snapshots enabled, which is the default for new installations

1 What is Snapper?

Snapper is a tool that helps create and manage file system snapshots. File system snapshots allow keeping a copy of the state of a file system at a certain point of time. Snapper can create and compare snapshots, revert between snapshots, and supports automatic snapshot timelines. Snapper never modifies the content of snapshots.

1.1 What can Snapper do?

Snapper has a command-line interface that allows you to create, delete and compare snapshots and to undo changes made between snapshots.

Using Snapper, you can perform the following tasks:

  • Undo system changes made by zypper.

  • Restore files from previous snapshots.

  • Do a system rollback by booting from a snapshot.

  • Manually create and manage snapshots, within the running system.

  • Perform automatic snapshot cleanup.

1.2 Supported storage setups

You can use Snapper to create on-disk backups of user data. As the basis for this functionality, Snapper supports the following storage setups:

  • Btrfs, a copy-on-write file system for Linux that natively supports file system snapshots of subvolumes.

  • Thinly provisioned LVM volumes formatted with XFS and ext4.

Note
Note

You can also boot from Btrfs snapshots.

2 Snapshot types in Snapper

Snapshots do not differ technically. Snapper distinguishes them by the event that triggers them and by how it handles them: as a pre and post pair or as a single snapshot, and with which cleanup algorithm.

Table 1: Overview of snapshot kinds

Kind

Triggered by

Type

Cleanup algorithm

Default

Installation (standard systems)

Package changes with zypper or another tool based on libzypp

pre and post pair

number

Enabled

Installation (immutable systems)

Package changes (each transactional-update run)

single

number

Always enabled, cannot be disabled

Timeline

The snapper-timeline.timer systemd timer (hourly)

single

timeline

Disabled for the root partition

2.1 Installation snapshots

When you install, update or remove packages, snapshot behavior depends on the type of your system. Standard systems have a read-write root file system. Immutable systems (also called transactional systems), such as SUSE Linux Micro, use a read-only root file system and are changed with transactional-update.

Standard systems

When you change packages with zypper or another tool based on libzypp (such as PackageKit), a pair of snapshots is created: one before the system change (“pre”) and one after it (“post”). Installation snapshots are enabled by default. To disable them, uninstall the package snapper-zypp-plugin.

Immutable systems

On immutable systems, no pre and post snapshots are created. Instead, each change (each transactional-update run or zypper) creates a single new snapshot, and you must boot into it for the change to take effect. These snapshots are an essential part of the system and cannot be disabled.

On both system types, Snapper marks snapshots that update critical system components (such as the kernel) as important (important=yes in the Userdata column) and deletes old snapshots automatically. By default, up to ten important snapshots and up to ten “regular” ones are kept.

Installation snapshots are also called numbered snapshots, because Snapper cleans them up with the number algorithm. See Section 4, “How does Snapper clean up old snapshots?”.

2.2 Timeline snapshots

Timeline snapshots are disabled for the root partition by default. When you enable them, Snapper creates one snapshot every hour. The snapshots are created by the snapper-timeline.timer systemd timer. To change how often snapshots are created, modify this timer, as this cannot be configured within Snapper itself.

The cleanup of timeline snapshots is based on hourly, daily, weekly, monthly, quarterly and yearly intervals. By default, Snapper keeps the last ten hourly snapshots and the first snapshot of each of the last ten days, months and years. It deletes older snapshots automatically.

2.3 Pre, post and single snapshots

By time of creation, Snapper recognizes three snapshot types. They do not differ physically, but Snapper handles them differently.

pre

A snapshot of a file system before a modification. Each pre snapshot corresponds to a post snapshot. For example, this is used for installation snapshots on standard systems.

post

A snapshot of a file system after a modification. Each post snapshot corresponds to a pre snapshot. For example, this is used for installation snapshots on standard systems.

single

A stand-alone snapshot. This is the default type when creating snapshots. For example, this is used for timeline snapshots and for installation snapshots on immutable systems.

2.4 Example list of snapshots

On a standard system, a fresh installation followed by two software changes made through PackageKit looks like this:

> sudo snapper list
# | Type   | Pre # | Date                             | User | Used Space | Cleanup | Description           | Userdata
--+--------+-------+----------------------------------+------+------------+---------+-----------------------+---------------
0 | single |       |                                  | root |            |         | current               |
1*| single |       | Fri 02 Oct 2026 03:26:40 PM CEST | root | 180.88 MiB |         | first root filesystem |
2 | pre    |       | Mon 05 Oct 2026 02:25:42 PM CEST | root | 689.28 MiB | number  | zypp(packagekitd)     | important=yes
3 | post   |     2 | Mon 05 Oct 2026 02:28:19 PM CEST | root | 105.41 MiB | number  |                       | important=yes
4 | pre    |       | Tue 10 Nov 2026 03:18:44 PM CET  | root |   7.41 MiB | number  | zypp(packagekitd)     | important=yes
5 | post   |     4 | Tue 10 Nov 2026 03:19:33 PM CET  | root |  31.88 MiB | number  |                       | important=yes

The asterisk (*) next to a snapshot number marks the snapshot that is currently mounted as the root file system. It is also the default snapshot to boot from.

Snapshot 0 with the description current is not a real snapshot. It always refers to the current state of the running system. The installer creates snapshot 1 with the description first root filesystem. It contains the initial installation of the system. In a post snapshot, the Pre # column shows the number of the matching pre snapshot.

3 Snapper default setup

Snapper is set up as an undo and recovery tool for system changes. By default, the installer formats the root partition (/) of SUSE Linux Enterprise Server with Btrfs and enables snapshots for it. When calculating the size of the root partition, the installer reserves additional space for snapshots.

Warning
Warning: Enabling Snapper after the installation changes the setup

Enabling Snapper in an installed system results in differences in the subvolume layout and variables, among other things. The setup then differs from the setup that this article describes.

We strongly recommend deciding whether you need snapshots before you start the installation.

To install a standard system without snapshots, disable Btrfs snapshots for the root partition in the storage settings of the installer. In this case, you can still create snapshots manually. Keep an eye on the available disk space.

Warning
Warning: Never disable snapshots on immutable systems

Snapshots are essential for immutable systems. Every transactional-update run creates a new snapshot, and the system relies on these snapshots to apply changes and to roll back. Do not disable Btrfs snapshots for the root partition on these systems. For more information, see Section 2.1, “Installation snapshots”.

3.1 What does the default configuration include?

The default configuration for the root partition is stored in /etc/snapper/configs/root. Each partition or Btrfs subvolume managed by Snapper has its own file in this directory. The file defines whether timeline snapshots are created (TIMELINE_CREATE) and the cleanup limits (for example, NUMBER_LIMIT or TIMELINE_LIMIT_HOURLY). Installation snapshots are enabled are not controlled by this file. For more information, see Section 2.1, “Installation snapshots”.

To view or change values, edit the file directly or run sudo snapper -c root get-config and sudo snapper -c root set-config "KEY=value".

Which directories are excluded is not set in this file. It is determined by the subvolume layout created at installation. For the list of excluded subvolumes, see Section 3.2, “Subvolumes excluded from snapshots”. For detailed information about the types of snapshots and when they are created, see Section 2, “Snapshot types in Snapper”. For more information on the cleanup parameters, see Section 4, “How does Snapper clean up old snapshots?”.

The size of the root partition is product-specific. To check the size and usage of the root partition, run:

> df -h /

3.2 Subvolumes excluded from snapshots

When Snapper is configured to operate on root, the subvolumes listed below are excluded from snapshots by default. A rollback restores everything contained in the snapshot. If data such as user files, logs, databases or virtual machine images were part of it, a rollback would revert them to the snapshot's state, and any newer data would be lost. A rollback of the boot loader configuration could also leave the system unable to boot. Therefore, directories that hold such data are placed on separate subvolumes, which are excluded from snapshots.

/boot/grub2/i386-pc, /boot/grub2/x86_64-efi, /boot/grub2/arm64-efi, /boot/grub2/powerpc-ieee1275, /boot/grub2/s390x-emu

A rollback of the boot loader configuration is not supported. The directories listed above are architecture-specific. The first two directories are present on AMD64/Intel 64 machines, the others on AArch64, POWER and IBM Z, respectively.

/home

If /home does not reside on a separate partition, it is excluded to avoid the loss of user-created data on rollbacks.

/opt, /usr/local

These directories are used when manually installing third-party products. They are excluded to avoid uninstalling these installations on rollbacks.

/root

The home directory of the root user. It is excluded to avoid the loss of data on rollbacks.

/srv

Contains data for Web and FTP servers. It is excluded to avoid data loss on rollbacks.

/var

This directory contains many variable files, including logs, temporary caches, third-party products in /var/opt, and is the default location for virtual machine images and databases. Therefore, this subvolume is created to exclude all of this variable data from snapshots and has copy-on-write disabled.

Note
Note: Temporary file systems

The /tmp and /run directories are not Btrfs subvolumes. They are mounted as tmpfs, which is kept in memory and not on the disk. Therefore, their content is never included in snapshots and is lost when the system reboots.

Tip
Tip

The list of subvolumes is product-specific. To see what subvolumes are created under / and therefore see which directories are excluded from the default snapshots behavior, run:

> sudo btrfs subvolume list /

4 How does Snapper clean up old snapshots?

Snapper deletes old snapshots automatically to prevent the root partition from running out of space. The cleanup algorithms differentiate between timeline snapshots and numbered snapshots. Numbered snapshots are the installation snapshots created when you change packages: pre and post snapshots on standard systems, and single snapshots on immutable systems.

4.1 Cleanup criteria

You can configure the cleanup behavior based on the following criteria:

  • Number limit: The system can be set to automatically delete old snapshots when a certain count of snapshots is reached.

  • Age limit: Old snapshots can be deleted if they exceed a certain age, while still preserving a number of snapshots for each time period (hourly, daily, monthly, yearly).

  • Pre and post snapshot pairs:

    On standard systems, pre and post snapshot pairs that do not differ can be automatically deleted. This does not apply to immutable systems, which do not create pre snapshots, because the state before a change is the same as the post snapshot of the previous operation.

4.2 Cleanup parameters and defaults

The following parameters control the cleanup. The default values apply to the root partition.

Installation snapshots

For numbered snapshots, the cleanup is controlled by parameters such as NUMBER_CLEANUP, NUMBER_LIMIT, NUMBER_LIMIT_IMPORTANT, and NUMBER_MIN_AGE. The default values for the root partition are 2-10 for NUMBER_LIMIT and 4-10 for NUMBER_LIMIT_IMPORTANT. This means that Snapper keeps up to ten of the youngest snapshots of each kind, and reduces their number to the lower value if the root partition is running out of space.

Timeline snapshots

Timeline snapshots are disabled for the root partition by default (TIMELINE_CREATE="no"). If you enable them, the cleanup is based on the number of snapshots to keep for each interval. With the default values, Snapper keeps the last ten hourly snapshots and the first snapshot of each of the last ten days, months and years. The parameters include TIMELINE_CLEANUP, TIMELINE_MIN_AGE and interval parameters such as TIMELINE_LIMIT_HOURLY, TIMELINE_LIMIT_DAILY and so on.

5 For more information

For more information on the Btrfs file system, see to https://btrfs.readthedocs.io/.

For more information on Snapper, refer to https://snapper.io/documentation.html and to the man pages man 8 snapper and man 5 snapper-configs.

For more information on thinly provisioned LVM volumes, refer to man 7 lvmthin.