Forcing full file read in ZFS even when checksum error encountered

Dag-Erling Smørgrav des at des.no
Tue Feb 5 14:19:21 UTC 2008


Joe Peterson <joe at skyrush.com> writes:
> Dag-Erling Smørgrav <des at des.no> writes:
> > Joe Peterson <joe at skyrush.com> writes:
> > > When I try to copy the file, I get only 655360 bytes copied, and
> > > then the copy stops.  I assume this is because the next block is
> > > where the error is.
> > Try to lseek past it.
> Well, I'd like to actually read the "bad" data too, so I can see if it is
> really bad or if there is a metadata issue.  Basically, I'd like to recover
> all the file's bytes this once without having ZFS stop me due to the checksum
> failure, just for debugging purposes.  Is this impossible in ZFS?

There is now way to "read the bad data" since an unrecoverable checksum
error means that ZFS has no idea which of the multiple version of the
affected block is the right one.

(I assume this was a raidz pool; if not, imagine Nelson Muntz from the
Simpsons yelling "ha ha!" at you)

My advice is to use 'dd conv=noerror' with a sufficiently small block
size to recover what parts you can.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-fs mailing list