How to Disable the Ubuntu ‘Btrfs-scrub’ Service

The File System Maintenance Task

In Ubuntu Linux, the Btrfs (B-Tree File System) is an advanced, modern file system that supports snapshots, subvolumes, and built-in RAID capabilities. To ensure data integrity across these complex storage pools, Btrfs utilizes a “scrub” process. The btrfs-scrub service (often triggered via a systemd timer like [email protected]) periodically runs in the background, reading all data and metadata blocks on the drive, verifying their checksums, and attempting to repair any silent data corruption it finds.

While scrubbing is absolutely critical for long-term data health on Btrfs arrays, the automated background timer can be highly problematic. If you are running a high-performance database server or a real-time application, an unexpected Btrfs scrub can suddenly consume massive amounts of disk I/O, causing your applications to stutter or time out. For maximum performance consistency, many server administrators prefer to disable the automated background timer and run the scrub command manually during designated maintenance windows. You should only disable this if you are actively managing the file system yourself.

How to Disable the Btrfs-scrub Timer

You can stop the automated maintenance task by disabling the systemd timer.

Warning: Do not disable this if you never intend to run a scrub manually. Disabling scrubs permanently can lead to silent data corruption going unnoticed on Btrfs volumes.

  1. Open your Ubuntu Terminal or connect via SSH.
  2. First, check the status of the Btrfs timers (they are usually instantiated per mount point, such as [email protected] for the root partition):
systemctl list-timers | grep btrfs
  1. To disable the specific timer for the root partition (represented by the - symbol):
sudo systemctl stop [email protected]
sudo systemctl disable [email protected]
  1. If you want to prevent any Btrfs scrub timers from ever being activated by package updates or other scripts, mask the base template:
sudo systemctl mask [email protected]

Your Ubuntu server will no longer execute background I/O scrubs on your Btrfs volumes, leaving you free to run sudo btrfs scrub start / manually when appropriate.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.