Forcing full file read in ZFS even when checksum
error encountered
Nick Gustas
freebsd-stable at tychl.net
Tue Feb 5 13:38:28 UTC 2008
Joe Peterson wrote:
> Dag-Erling Smørgrav wrote:
>
>> 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?
>
> -Thanks, Joe
>
This may do what you want, but I'm not sure if this only disables
creation of checksums, or it disables use of preexisting checksums
entirely. The man page entry would suggest it disables them for reads
too. If this is the case, it should do what you want.
http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide#Checksums
Verify the type of checksum used:
zfs get checksum <filesystem>
Tuning is achieved dynamically by using:
zfs set checksum=off <filesystem>
And reverted:
zfs set checksum='on | fletcher2 | fletcher4 | sha256' <filesystem>
Fletcher2 checksum (the default) has been observed to consume roughly
1Ghz of a CPU when checksumming 500 MByte per second.
Man page:
checksum=on | off | fletcher2, | fletcher4 | sha256
Controls the checksum used to verify data integrity. The
default
value is "on", which automatically selects an appropriate
algorithm
(currently, fletcher2, but this may change in future
releases). The
value "off" disables integrity checking on user data.
Disabling
checksums is NOT a recommended practice.
More information about the freebsd-fs
mailing list