Reading a corrupted file on ZFS

Fabian Keil freebsd-listen at fabiankeil.de
Fri Feb 12 15:54:36 UTC 2021


Artem Kuchin <artem at artem.ru> wrote on 2021-02-12:

> 12.02.2021 18:06, Karl Denninger пишет:

> > Blocking the read forces you to get the good copy off backup media and 
> > thus prevents that from happening.
> >
> 
> I know what ZFS does and i damaged the same file in the same place on 
> purpose. Question is: how to read what's left of it. Just for kicks, i 
> don't have a backup, and i need to read what's left. It could be 1GB 
> file with only one byte damaged and it is of crazy importance to me. So, 
> how to bypass all the checks and make it read the file no matter what?

The patch from this PR adds a sysctl that allows to send corrupted data:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221909

Using the added sysctl you can send and receive the dataset and then
read the corrupted file from the received dataset. Note that ZFS replaces
corrupted blocks completely with the 0x'zfs badd bloc' pattern instead
of returning the corrupted data as is, thus increasing the amount of
corruption in case of simple bit flips to whole blocks.

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20210212/07ecda10/attachment.sig>


More information about the freebsd-fs mailing list