Solved Can errors be scrubbed later from a zfs mirror with one disk?

Hello,

I was reading this post for fun -
https://blogs.oracle.com/mmusante/entry/howto_replace_a_bad_disk

...and it made me curious to know if one has a simple two-disk zfs mirror set up, and:

1) one disk fails or is removed
2) while running on the one-disk degraded mirror, data errors get introduced (that is, *before* replacing the missing/damaged disk)

After the missing disk is replaced, can those errors that arose when the mirror was degraded (just one disk) then be corrected later with a scrub?

Thanks!
-bg
 
Generally speaking, of course not. Once a disk has failed, you only have the one disk left with your data on it. If that disk gets errors, they are permanent. When attaching a new disk, you have one new blank disk, and one existing disk with errors. There is nowhere for ZFS to get good copies of that data from.

The only possible exception is if the disk hasn't actually failed completely. If you've not fully removed it from the pool, either by offlining it or just physically removing it, the old disk will still show in the pool as OFFLINE or UNAVAIL. In that case, if you got some errors on the remaining 'good' disk, you could re-attach the failing disk and perform a scrub. As long as you're lucky enough for the blocks that have failed on the good disk to still be intact on the failing disk, the scrub may succeed in repairing it.
 
Data errors are always detected by ZFS, whether it can fix them or not, assuming no bugs.
You would get read/write or checksum errors listed next to the device in zpool status, and a 'permanent errors detected in the following files' list at the bottom showing the files that the errors have affected.
 
Back
Top