Housekeeping the BTRFS Filesystem

2025-02-04

I have serveral machines with BTRFS as root filesystem, however, many of them suffer from one issue: When reading large files, there's a chance of the disk failing.

While I'm looking for the causes, I've came across some good advices on maintaining the system:

There's script online that does the job automatically for the first three jobs, to use it, install sys-fs/btrfsmaintenance.

Then, modify the settings in /etc/default/btrfsmaintenance as fit, run /usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh systemd-timer to update the timer files. It also automatically starts the Systemd timer, if the period is not set to none.