ZFS error scrub
A ZFS error scrub is an integrity scan restricted to files already recorded with data errors.
OpenZFS 2.3 exposes this mode as zpool scrub -e and requires a prior scrub with head_errlog enabled. [1] It does not advance last_scrubbed_txg. [2]
A regular scrub verifies the checksums of all data and a resilver examines only data known to be out of date, while an error scrub re-reads only files with known data errors. It cannot run alongside a regular scrub or resilver, or while a regular scrub is paused. [1] The head_errlog feature keeps the error log per head dataset, and snapshots and clones of encrypted datasets whose keys are not loaded are not checked. [3]
Each logged block is read through the normal path, so checksum verification and redundancy repair apply, but only if its birth transaction group still matches, meaning it was neither freed nor rewritten. At most 4,096 blocks are handled per transaction group, so a 10,000-block log needs at least 3 groups and the work scales with the log, not with the pool. [4]
In a field study of storage systems, RAID groups were scrubbed about every two weeks, and scrubs found about 49% of checksum mismatches on nearline disks and 73% on enterprise disks. [5] Scrubbing in general serves to detect latent sector errors. [6]
Relations
Advantages
- It checks whether known errors are still present, for example after a restore or repair, at a cost proportional to the error log. [4]
Limitations
- It does not establish that files outside the known-error set are free of corruption. [1]
- Errors never hit by a read or scrub are missing from the error log, and the log is rotated after an error scrub completes. [4]
Citations
- OpenZFS 2.3: zpool-scrub(8), error-scrub scope and prerequisites
- OpenZFS 2.3: zpoolprops(7), last_scrubbed_txg
- OpenZFS 2.3 zpool-features(7), head_errlog feature.
- OpenZFS 2.3.0 module/zfs/dsl_scan.c and module/zfs/spa_errlog.c, error scrub.
- Bairavasundaram et al. An Analysis of Data Corruption in the Storage Stack. USENIX FAST 2008, section 2.
- Zhang et al. End-to-end Data Integrity for File Systems: A ZFS Case Study. USENIX FAST 2010.
Sources & caveats
- The feature is described only by the project's own manual pages and code; no independent description or measurement of the -e mode was found.
- Behaviour is for OpenZFS 2.3.0 and may change.
- The field study is university-led with co-authors from a storage company (NetApp); both FAST papers cover scrubbing only generically.
- Arithmetic: ceil(10,000 / 4,096) = 3 transaction groups.