Snapper space-aware cleanup on openSUSE: enable qgroups or keep quotas off?
0 reputation · 16 Oct 2021, 17:09 UTC
0 reputation · 16 Oct 2021, 17:09 UTC
openSUSE Leap and Tumbleweed ship a Btrfs root with Snapper preconfigured: package transactions create pre/post snapshot pairs, and the shipped root config leaves timeline snapshots disabled, pruning mainly by number and empty-pre-post rules. These defaults have shifted across releases, so they should be read from the installed system rather than assumed.
The open decision is quota accounting. Space-aware cleanup and the used-space column in snapper list require Btrfs quota groups, enabled via snapper setup-quota. Without them, cleanup is blind to how much space each snapshot actually consumes; with them, qgroups add documented performance and scalability overhead that has varied across kernel versions, especially on large or heavily snapshotted filesystems.
Measurement is complicated because shared extents and compression make plain du output misleading on Btrfs, and layout differs between classic Leap/Tumbleweed installs and MicroOS-style transactional systems. Any quota change is also stateful, so the trade-off should be settled before touching a working host.
Specific questions:
35275 reputation · 16 Oct 2021, 18:57 UTC
Enable Btrfs quota groups (qgroups) only if your root partition is frequently near capacity and you require Snapper to prune based on disk usage rather than count. For most users where count-based pruning (e.g., 'keep the last 10 snapshots') is sufficient, keep quotas off to avoid metadata overhead and potential latency.
The overhead of qgroups is not a constant tax but scales with the complexity of operations. On modern kernels (5.15+), the performance hit is significantly mitigated, but issues typically emerge under these specific conditions:
snapper list can become noticeably slow.snapper setup-quota can take hours and consume significant CPU.If your snapshots are primarily generated by zypper transactions, **count-based cleanup is usually sufficient**. These transactions are predictable in size. Space-aware pruning is worth enabling only if:
You can safely enable timeline snapshots and quotas together. They operate on different logic layers: timeline rules define when a snapshot is created and deleted, while qgroups define how the system calculates the space consumed. There is no technical conflict, though enabling both will increase the total metadata load mentioned above.
If you decide to enable quotas, use these commands to verify the system is behaving correctly:
# Enable quota groups for the root subvolume
sapper setup-quota root
# Verify Snapper can see used space
sapper list --space
# Check Btrfs qgroup status directly
btrfs qgroup show -/
Note: These commands assume a standard openSUSE Leap/Tumbleweed layout. If you are using MicroOS or a custom subvolume hierarchy, verify your subvolume path in snapper config.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.