Tuning Snapper | BTRFS Snapshot Management on openSUSE

BTRFS on openSUSE.png

Throughout my time helping users with openSUSE, one reoccurring issue that I have heard or read from some users has been the issue of system snapshots by Snapper filling up the root file system. Users have complained that their root file system fills up which ultimately locks up their system. This is often caused by setting up the root partition with an insufficient size, less than 40 GiB. Some users may not want to allocate that much space so a common course of action is to either use BTRFS without snapshots, use XFS or ext4.

There is this misguided impression that BTRFS is not a file system to be trusted but I can, with great assurance tell you that I have yet to have an issue with the file system. If you disagree with this than your perception is based on either a non-openSUSE implementation or if you had problems on openSUSE you did not satisfy its recommendation.

BTRFS with snapshots is a good option for newer machines but your disk partition size may be less than the recommended 40GiB for root, here is what you can do to adjust Snapper. As root open the following file in your editor of choice:

/etc/snapper/configs/root

Scan down the configuration file and look for the line #limit for number cleanup section. To limit the total number of snapshots, adjust the NUMBER_LIMIT and NUMBER_LIMIT_IMPORTANT lines.

I changed mine to the following:

# limit for number cleanup
NUMBER_MIN_AGE=”1800″
NUMBER_LIMIT=”2-6″
NUMBER_LIMIT_IMPORTANT=”4-6″

After this adjustment, I have no more than 6 total file system snapshots and it reduced the space taken up by snapshots by about 10 GiB. It should be understood that your mileage may vary depending on how much you fiddle with your system and how much software you have installed.

Final Thoughts

openSUSE is such a stable distribution, even the rolling release, Tumbleweed, that snapshots are almost not necessary. I personally look at snapshots as a kind of insurance policy but the fact is, as long as I have a working internet connection and a working terminal, entering sudo zypper dup (in Tumbleweed) will likely fix any issues I may have caused. As far as Leap is concerned, I haven’t seen an update that brok a system which would require a rollback. That doesn’t mean something couldn’t slip past openQA that may affect your system, I just haven’t seen it.

Also note, I have such confidence in openSUSE Tumbleweed with BTRFS, it is what is on my home server. In over a year, not one update has broken any of the servers or messed with any configurations. It should also be noted that I run older and generally Linux friendly hardware so my chance at issues is much less.

Further Reading

SUSE.com Snapper Cleanup

2 thoughts on “Tuning Snapper | BTRFS Snapshot Management on openSUSE

  1. “BTRFS with snapshots is a good option for newer machines”
    BTRFS is a not-so-good option for older machenes, where the HDD nearly reaches it’s EOL (even when tests say the HDD is okay). I had a lot of serious problems (non-booting system) with BTRFS on my quite-old machine (that I never experienced before with openSUSE). I switched to Ext4 and the problems were gone.
    I did a internet search and found out that BTRFS seems to work good on newer machines, but there might be problems on older hardware that reaches EOL.

    1. I actually use the snapshots on some older machines but I would agree with you, on an HDD that can be problematic when it is doing maintenance and clearing things out. I have a 2010 netbook with an SSD, using BTRFS and snapshots. It runs openSUSE Tumbleweed and I am very pleased with the system performance. Multimedia performance… well…the wheels of technology have moved on.

Leave a Reply