Under consideration

Add Btrfs balancing cron job to Cumulus Linux?

  • 16 March 2019
  • 1 reply


We've recently had a few switches (MSN 2100 and 2700s) lock up due to running out space. This was purely due to Btrfs becoming very unbalanced. After a few rounds of progressive balancing, well over 50% of the drive space was recovered. It would seem that our situation occurred due to snapshots resulting from frequent net commits and several apt installs.

In an attempt to prevent this from happening in the future we've added the following simple cron job

root@isp0:~# crontab -l
0 3 * * * /sbin/btrfs balance start -dusage=50 -musage=50 /

It's been a relatively short time we've had this going so I cannot say for sure if it's effective or not, but it seems like this should be something that Cumulus configures by default?


1 reply

Userlevel 4
Hi @Ryan Goodfellow I spoke with one of our Linux gurus here and he said the rebalance should be a one-time thing, not a cron job. He said if you're doing enough activity on the file system to balance more than once every year or two, you'll wear out the flash really quickly.