skip to content

A SUSE Linux Enterprise 15 server installed with the default Btrfs root layout misbehaves after a routine package update. What does SUSE's default snapper integration give you, how do you use it to recover, and what does it not protect?

level: seniorimportance: should knowfreq 42%

answer

  1. pre and post around every transaction
  2. snapshots are cheap, so rollback is routine
  3. bootloader can start a read-only snapshot
  4. the layout decides what reverts
  5. same disk, so not a backup

basics

~20 s

SUSE's default Btrfs root has snapper take pre- and post-snapshots around every zypper transaction. The GRUB menu can boot the pre-update snapshot, and snapper rollback makes it permanent — reverting system state, not application data.

solid answer

~50 s

On a default SUSE install the root filesystem is Btrfs and `snapper` is wired into the package manager, so every zypper transaction is bracketed by a *pre* and a *post* snapshot; YaST changes are snapshotted too. Recovery is therefore a supported operation rather than a restore: `snapper list` shows the numbered snapshots with the command that created them, `snapper status <pre>..<post>` shows exactly what that update changed, and if the machine will not boot you pick the snapshot from the bootloader menu, which boots it read-only. Once you have confirmed the older state is good, `snapper rollback` makes that snapshot the new default subvolume and a reboot completes the switch — the RPM database goes back with it, so zypper stays consistent. The critical limit is scope: the installer deliberately places `/home`, `/srv`, `/opt` and the variable parts of `/var` outside the root snapshot, so data and logs are *not* reverted. Snapshots also live on the same disk, so they are recovery, not backup.

code

bash · 9 lines
bash
# what happened, and when
snapper list

# exactly which files the update changed, pre -> post
snapper status 105..106

# make the pre-update snapshot the new default root, then reboot
snapper rollback 105
reboot

go deeper

for a junior

Know that SUSE installs a Btrfs root with snapper by default and that snapshots are taken automatically around package updates, so a bad update can be undone. Be able to say the snapshots live on the same disk.

for a middle

Explain the pre/post snapshot pair around each zypper transaction, how to inspect what changed between them, and that rollback works by switching the default subvolume rather than copying files back.

for a senior

Demonstrate the operational judgment: which incidents rollback actually solves, the excluded data subvolumes that make an application rollback incomplete, the read-only verification boot before committing, and snapshot space as ongoing capacity work.

for a principal

Own the recovery strategy: where snapper sits relative to real backups and disaster recovery, how coordinated system-plus-data restore is defined and rehearsed, and whether a transactional or immutable update model is worth adopting for the estate.

## What the installer sets up SUSE's installer defaults to Btrfs for the root filesystem with a deliberate subvolume layout, and configures `snapper` against it. Two integrations then come for free: - **Package-manager snapshots.** Every zypper transaction is bracketed by a *pre* snapshot taken before the transaction and a *post* snapshot taken after it, tagged with the command that ran. YaST operations are snapshotted the same way. - **Timeline snapshots and cleanup.** Periodic snapshots plus automatic cleanup algorithms so the set does not grow without bound. Because Btrfs snapshots are cheap references to the existing extents rather than copies, taking one before every update is affordable in a way it would not be on a traditional filesystem — which is the whole reason SUSE can make rollback a routine, supported operation instead of a restore procedure. ## What is snapshotted, and what is deliberately not The subvolume layout is the part people skip, and it is the part that decides whether a rollback helps you. The installer puts the directories that hold *data* — `/home`, `/srv`, `/opt`, and the variable parts of `/var` such as logs, spools and database directories — into subvolumes that are **not** part of the root snapshot. That is intentional. You want to revert the *system* (`/usr`, `/etc`, the installed package set and the RPM database) without also reverting a week of mail, a database's write-ahead log, or your audit logs. But it means a rollback answers exactly one class of incident: **the update broke the system.** It does not answer "the application corrupted its own data". ## The recovery path If the machine still boots: ```bash snapper list # numbered snapshots, type pre/post, the command that ran snapper status 105..106 # exactly which files that update changed snapper diff 105..106 /etc/some.conf snapper rollback 105 # make snapshot 105 the new default, then reboot ``` If it does not boot, the bootloader menu carries a submenu for starting from a read-only snapshot. You select the pre-update snapshot, the system comes up with that root mounted read-only, you verify it is the good state, and then run `snapper rollback` from inside it and reboot to make it permanent. ## What rollback actually does `snapper rollback` does not copy files backwards. It creates a new writable snapshot from the target snapshot and sets it as the default subvolume, so the next boot mounts that as `/`. The previous state is itself kept as a snapshot, so the operation is reversible — you can roll forward again if the rollback turns out to be the wrong diagnosis. A consequence worth stating in an interview: because `/usr` and the RPM database revert together, the package manager's view of the world stays consistent. You do not end up with a database claiming a package version whose files are not on disk, which is exactly the mess that hand-restoring files from a backup produces. ## Limits and the failure modes people actually hit **It is not a backup.** The snapshots share the disk with the data they describe. A failed disk, a destroyed volume, a ransomware event with root — all of them take the snapshots with them. Snapper complements offsite backups; it does not replace them. **Data divergence after rollback.** The single most common real-world disappointment: an application upgrade migrated its database schema, the system is rolled back to the old binaries, and the old binaries now face a migrated database they cannot read. You must have a plan for the data half — the application's own dump, or a coordinated snapshot of its subvolume — and know which order to restore in. **Space.** Snapshots pin old extents, so deleting a large file whose blocks are still referenced by a snapshot frees nothing. On a busy machine the snapshot set can fill the root filesystem, and a full root filesystem is an outage. The handles are the per-configuration cleanup settings under `/etc/snapper/configs/` — how many numbered snapshots to keep, how long to keep timeline snapshots, and a space limit — plus `snapper delete` for one-offs and `snapper cleanup` to run an algorithm now. Reviewing these on a server that updates frequently is ordinary capacity work, not an emergency measure. **Scope of the boot path.** Rolling back returns the kernel and initramfs that were installed at snapshot time, which is what you want after a bad kernel update — but firmware-level and bootloader-level state outside the filesystem is not covered. ## Where SUSE takes this further The same primitive underpins SUSE's transactional model for its immutable variants, where updates are applied to a new snapshot that only becomes active on the next boot, so a failed update never touches the running system at all. Mentioning that shows you understand snapper as the foundation of SUSE's update story rather than as a desktop convenience. ## What the interviewer is checking That you know rollback is a first-class, supported operation on SUSE — that is the distro's genuine differentiator — *and* that you immediately name its boundary. A candidate who says "snapper, so we just roll back" without mentioning that data subvolumes are excluded has not lived through the aftermath.

  • You rolled the system back after a failed application upgrade, but the application still fails to start. Why?
    Because the rollback reverted the system, not the data. The installer keeps `/var`, `/srv` and `/home` outside the root snapshot, so a database whose schema the upgrade migrated is still migrated while the binaries are old. You need the application's own backup or a separate snapshot of its data, and a decision about which side to move — roll the data back too, or roll the system forward.
  • The root filesystem on a SLES box is full and snapper snapshots are the cause. What are your handles?
    The per-configuration cleanup settings under `/etc/snapper/configs/` control how many numbered snapshots are kept, how long timeline snapshots survive, and the space budget snapper will use. Tighten those and run `snapper cleanup` to apply them now, or `snapper delete` specific snapshots. Longer term, a machine that updates frequently needs those limits reviewed as capacity planning rather than firefighting.
  • Does booting a snapshot from the bootloader menu already commit the rollback?
    No. That boot mounts the snapshot read-only so you can verify it is the state you want; nothing is committed. You make it permanent by running `snapper rollback` from within that session, which creates a writable snapshot from it and sets it as the default subvolume, and then rebooting. Until you do, the next normal boot returns to the broken system.

saying these in an interview costs you the question

  • Calls Btrfs snapshots a backup of the server
  • Expects rollback to restore databases and /home
  • Thinks booting a snapshot from the menu is permanent
  • Assumes snapper reverts files by copying them back
  • Lets snapshots grow until the root filesystem fills

context