Ubuntu 26.04 LTS ZFS Scrub Scheduling

Infrastructure

By Jennifer Webb

Updated on Aug 22, 2026

Ubuntu 26.04 LTS ZFS Scrub Scheduling

Learn Ubuntu 26.04 LTS ZFS scrub scheduling with a systemd timer, verify runs, and confirm your pool is checked automatically.

Introduction

This tutorial shows how to set up automated ZFS scrub scheduling on Ubuntu 26.04 LTS for a dedicated server. You will create a reusable systemd service and timer pair, then verify that the scrub runs on schedule and that the pool reports the expected status.

Regular scrubs help surface latent checksum issues before they become operational problems. For storage administrators, this is a practical way to keep a ZFS pool under routine integrity checks without relying on ad hoc manual runs.

Prerequisites

  • Ubuntu 26.04 LTS installed on the server.
  • Root access or a normal administrative user with sudo privileges.
  • A configured ZFS pool on the dedicated server.
  • Network access if your system still needs package installation or updates.
  • Ability to edit systemd unit files with a terminal editor such as nano.

Tutorial steps

Check the current ZFS pool and scrub status

Before scheduling anything, confirm the target pool exists and review its current scrub state.

sudo zpool status

Identify the pool name you want to schedule. If the status output already shows a scrub in progress or a recent scrub with errors, resolve that operational issue before adding automation.

Create a systemd scrub service

Create a templated service unit that can run a scrub against one pool name passed as the systemd instance.

sudo nano /etc/systemd/system/[email protected]

Add the following unit contents.

[Unit]
Description=ZFS scrub for pool %I
Requires=zfs-import.target
After=zfs-import.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/zpool scrub %I

This service starts a scrub for the named pool and exits once the command is submitted to ZFS.

Create the scrub timer schedule

Next, define when the service should run. This example uses a weekly timer; adjust only the schedule fields if you need a different cadence.

sudo nano /etc/systemd/system/[email protected]

Add the timer contents below.

[Unit]
Description=Weekly ZFS scrub for pool %I

[Timer]
OnCalendar=Sun *-*-* 03:00:00
Persistent=true
Unit=zfs-scrub@%I.service

[Install]
WantedBy=timers.target

The Persistent=true setting helps ensure the scrub is queued after downtime if the scheduled time was missed.

Enable and start the timer

Reload systemd so it recognizes the new units, then enable and start the timer for your target pool.

sudo systemctl daemon-reload
sudo systemctl enable --now zfs-scrub@<pool>.timer

Replace <pool> with the actual ZFS pool name you confirmed earlier.

Verify the scheduled scrub configuration

Check that systemd loaded the timer and that it has a next run time.

sudo systemctl status zfs-scrub@<pool>.timer
sudo systemctl list-timers --all

Confirm the timer is enabled, active, and associated with the correct pool instance. The timers list should show the next scheduled run.

Trigger and verify a manual scrub

Run the scrub service manually to confirm the unit executes correctly before waiting for the scheduled time.

sudo systemctl start zfs-scrub@<pool>.service

Then review the service journal and ZFS pool status.

sudo journalctl -u zfs-scrub@<pool>.service
sudo zpool status

For verification, the service should report a successful exit status, the journal should show the scrub command being issued and completed, and zpool status should show the scrub as running or finished without errors.

Verification

After setup, confirm all of the following on the dedicated server:

  • The target pool exists and is the one referenced by the timer instance.
  • sudo systemctl list-timers --all shows the timer loaded, enabled, and scheduled for the next run.
  • sudo systemctl status zfs-scrub@<pool>.timer reports the timer as active.
  • sudo systemctl start zfs-scrub@<pool>.service completes successfully.
  • sudo journalctl -u zfs-scrub@<pool>.service records the scrub command execution and completion.
  • sudo zpool status reports a healthy scrub state with no new errors.

Troubleshooting

If the timer appears inactive, confirm that both unit files are saved correctly and that sudo systemctl daemon-reload was run after editing them.

If the service fails immediately, verify that the pool name in the instance matches the actual ZFS pool name and that the system can access /usr/sbin/zpool.

If zpool status does not show the expected scrub activity, check the journal for unit errors and make sure no other scrub is already running on that pool.

Rollback

If you want to remove the scheduled scrub, stop and disable the timer instance, then delete the custom unit files.

sudo rm /etc/systemd/system/[email protected] /etc/systemd/system/[email protected]

After removing the files, reload systemd so it forgets the units and verify that the timer no longer appears in the timers list.

Conclusion

You have now configured Ubuntu 26.04 LTS ZFS scrub scheduling for a dedicated server, verified that the timer runs, and confirmed that the scrub output is visible through both systemd and ZFS status checks. After completing this tutorial, you can confirm that your pool is being checked automatically on schedule and that the recorded scrub results are healthy.