Details on ZFS scrubbing repairs requirements/guarantees

zfs

I found no details on how repairing works and what the requirements are from the docs.

For automatic repairs from a scrub do I need to mirror? RAIDZ? Either? Neither (do the checksums themselves contain parity)?

Best Answer

There is no parity on ZFS blocks so they are not "self repairing".

Scrubbing try to repair corruption errors by relocating blocks with an incorrect checksum elsewhere. It can only do it if a sane copy of the faulty blocks exist on the pool.

The chance for the latter to be true is quite high if you are using redundancy (mirroring or raidz) but is still present for single device pools or stripes if the checksum error affects:

  • a metadata block as they are (at least) duplicated by default
  • a data block from a dataset configured with ditto blocks (copies=2 or more)