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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.