In Ubuntu Server environments utilizing the ZFS file system, data integrity is maintained through periodic “scrubbing”—a process that traverses the entire storage pool, reads all data and metadata blocks, and verifies them against their checksums to detect and repair silent data corruption. By default, Ubuntu installs a systemd timer (zfs-scrub.timer) that automatically schedules a scrub of all active ZFS pools on the second Sunday of every month. While crucial for data health, automated scrubs consume massive amounts of disk I/O and CPU resources. On highly utilized production databases or latency-sensitive storage arrays, an unexpected scrub kicking off can cause catastrophic performance degradation. Administrators often prefer to execute scrubs manually during designated, closely monitored maintenance windows.
This guide explains how to completely disable the zfs-scrub timer in Ubuntu Server, preventing the system from initiating automated ZFS pool scrubs.
Stop and Mask the ZFS Scrub Timer
To guarantee that the server never triggers an automated scrub, we must stop the timer and explicitly mask it to prevent systemd from resurrecting it during package updates or reboots.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - First, check if the timer is currently active and scheduling events:
sudo systemctl status zfs-scrub.timer - Stop the timer immediately:
sudo systemctl stop zfs-scrub.timer - Next, disable the timer to remove its symlinks from the systemd schedule:
sudo systemctl disable zfs-scrub.timer - For absolute certainty, explicitly mask the timer. This symlinks the unit file to
/dev/null, creating a hard block against it starting under any circumstances:sudo systemctl mask zfs-scrub.timer
Verify the Service Lockdown
By masking zfs-scrub.timer, you guarantee that the Ubuntu OS will never autonomously initiate a high-I/O ZFS scrub, leaving pool maintenance entirely under your manual control.
To verify the lockdown is successful, attempt to start the timer manually:
sudo systemctl start zfs-scrub.timer
Systemd will return a fatal error stating that the unit is masked (e.g., Failed to start zfs-scrub.timer: Unit zfs-scrub.timer is masked). Additionally, you can list all active timers using systemctl list-timers --all; the ZFS scrub routine will be completely absent from the schedule, confirming your storage array’s performance is protected from unexpected background maintenance.