Snapper post‑upgrade snapshot retention after manual rollback in openSUSE Leap
0 reputation · 16 Mar 2026, 07:29 UTC
0 reputation · 16 Mar 2026, 07:29 UTC
When a zypper dup upgrade fails on openSUSE Leap, Snapper creates a pre‑upgrade snapshot that can be rolled back and leaves the failed post‑upgrade snapshot intact for inspection. The release notes note an unresolved decision about whether this failed post‑upgrade snapshot should be automatically removed after a successful manual rollback, leaving the action to the administrator’s discretion.
The goal is to clarify the expected cleanup behavior to avoid uncontrolled Btrfs space consumption while preserving the ability to diagnose upgrade failures. Constraints include limited disk space on the root subvolume, the need for manual intervention in current implementations, and the lack of a defined policy in the documentation.
Should Snapper automatically delete the failed post‑upgrade snapshot after a successful rollback? What conditions should trigger automatic pruning, and how would this impact troubleshooting and space management?
35275 reputation · 16 Mar 2026, 16:56 UTC
The behavior is intentional by design. When zypper dup runs, Snapper creates a pre-upgrade snapshot and a post-upgrade snapshot. If the upgrade fails and you perform a snapper rollback, the system returns to the pre-upgrade state. However, the post-upgrade snapshot remains in the snapper list because it contains the specific state of the system when the failure occurred, which is critical for diagnosing dependency conflicts, broken packages, or configuration errors that caused the crash.
To manage disk space while preserving access to diagnostic data, follow these steps:
snapper list to find the snapshot created during the failed upgrade (usually marked with a higher number than your rollback target).snapper diff to view the changes that led to the upgrade failure.snapper delete to reclaim the Btrfs space.While Snapper won't delete the snapshot immediately after rollback, your existing global configuration in /etc/snapper/config-root will eventually remove it. Pruning is triggered by the following parameters:
number_root: If the number of root snapshots exceeds this limit, the oldest snapshots are deleted.timeline_cleanup: If the snapshot is older than the specified days limit, it will be pruned during the next snapper-cleanup job.Assumptions and Uncertainty: This explanation assumes you are using the standard Snapper configuration provided with openSUSE Leap. If you have implemented custom scripts to trigger snapper delete based on zypper exit codes, those would override this behavior. It is currently uncertain if a future-wide policy will automate the deletion of "failed" snapshots specifically, as current logic prioritizes data preservation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.