ZFS scrub on Rocky 8

We have several Ubuntu ZFS servers that we’re reinstalling with Rocky 8. I noticed that Ubuntu ZFS performs a scrub once in a while, the second Sunday it looks like, but they’re not automatically running on Rocky 8. I was wondering if anyone has a preferred/recommended way of scheduling ZFS scrubs in Rocky?

Thanks,
Kevin

I have an cronned pipeline that asks zpool history which pool was least recently scrubbed and starts a scrub on it, but that’s because the distribution of our pools is more dynamic than is ideal. If you have a more straightforward setup, it’s probably easiest to use the systemd timers documented at the end of the zpool-scrub(8) man-page.

1 Like

That worked @quartsize thanks for your help! I forgot that one of our servers is still running EL7–this systemd timer doesn’t seem to be available but I can probably duplicate it w/ cron until we can upgrade to Rocky 8.

Thanks!
Kevin

There are timers for weekly and monthly scrubs.

Example, enable monthly scrubs for a zpool named “zexample”:

sudo systemctl enable zfs-scrub-monthly@zexample.timer --now

EDIT: Sorry, missed the end of quartsize’s response, same info.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.