Peri­od­ic scrub­bing of ZFS pools

I no­ticed that we do not have some auto­mat­ic way of scrub­bing a ZFS pool peri­od­ic­ally. A quick poll on fs@ re­vealed, that there is in­terest in some­thing like this. So I took a little bit of time to write a peri­od­ic daily script which checks if the last scrub is X days ago and scrubs a pool ac­cord­ingly. The script has op­tions to scrub all pools, or just a spe­cif­ic sub­set. It also al­lows to spe­cify a time–in­ter­val between scrubs for each pool with dif­fer­ent levels of fall-​back (if no pool-​specific in­ter­val is set, the de­fault in­ter­val is used, which is set to 30 days if no oth­er de­fault in­ter­val is spe­cified).

The dis­cus­sion about this is hap­pen­ing over at fs@, so go there and have a look for the CFT (with a link to the WIP of the script) and the dis­cus­sion if you are in­ter­ested.

So far there are some minor de­tails to sort out (and a little bit of doc­u­ment­a­tion to write) be­fore I can com­mit it… prob­ably next week.

2 thoughts on “Peri­od­ic scrub­bing of ZFS pools”

  1. Pingback: Tweets that mention Peri­odic scrub­bing of ZFS pools | Alexander Leidinger --
  2. Doesn’t cre­at­ing a snap­shot [still] cause the scrub to re­start from square one?

    I already have cron jobs that cre­ate snap­shots every hour, on a pool where a scrub takes more than an hour, this could be a prob­lem…

Leave a Reply

Your email address will not be published. Required fields are marked *