I ZFS scrub once a month which takes ~24 hours for the 72TB. For what I can find about how often I should scrub is:

  • very busy pools, once per week
  • not so busy pools, once per month

or run a scrub, measure the time, and adjust accordingly.

But what about online defragmention?


Is online defragmention considered good practice like scrubbing is? And if, how often should I degrag?

  • 5
    Due to the way this question is worded, I feel it necessary to emphasise that a ZFS scrub does not defrag, see Nex7's comment for what a scrub does. The title asks about defrag, most of the body talks about scrub, and the last line asks about defrag, this is why I voted down this question. – BeowulfNode42 May 25 '14 at 0:56

This is not something you need to so often. Mainly because there's no notion of online defragmentation in ZFS. That's really only possible by copying the pool data to another pool or rewriting to new storage. Strive to keep your zpools below 70% utilization instead.

  • 20
    I would say not /nearly/ so often. A scrub simply reads every block on the system. That's all it does. By virtue of how ZFS handles reads, ZFS will automatically repair any bad blocks when they're read. This means a scrub is only necessary to read data that isn't commonly being read anyway. Thus, the asker's comment of very busy pools once per week and not so busy pools once per month is actually backwards. A very busy pool, especially one that reads the majority of the live data regularly, need not scrub that often. A quiet pool that is rarely accessed should scrub more often. – Nex7 Dec 8 '13 at 17:04
  • It's important to at least scrub reasonably often (or, more generally, ensure all of the drive data gets read often) because otherwise, ZFS will have no idea what the status of the data on the disk actually is, and you may find upon resilvering after a disk failure that your redundant drives contain corrupted data that went undetected due to lack of reads (and then restore your data from backup, or just lose it) – Thomas Apr 22 '17 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.