Reading a corrupted file on ZFS

Artem Kuchin artem at artem.ru
Fri Feb 12 15:42:02 UTC 2021


12.02.2021 18:06, Karl Denninger пишет:
> On 2/12/2021 09:53, Artem Kuchin wrote:
>>
>> Now i am stuck in worst situation that with UFS - i cannot read 
>> what's left of this file.
>>
>> I deleted the file and the scrubbed - error went away. But i lost the 
>> file.
>>
>> So, the question is how to read the file with an error ? I googled 
>> for 2 hours and still did not find a solution.
>>
>>
>>
>>
> With what you did both copies are damaged and non-repairable.
>
> Neither block on the two mirror copies has a correct checksum 
> therefore neither copy is good; both were damaged "at the same time".  
> The system knows the file is corrupt and thus the contents are not 
> usable, but it has no way to fix it because both copies are damaged 
> with no means of correction.
>
> The correct answer to what to do is IMHO what ZFS does.  The only 
> solution in such a case is to restore from a backup.
>
> You *definitely* do not want the system to silently let you proceed in 
> such an instance because now you will *propagate* the damaged file 
> without knowing it was damaged, which will then wind up in your backup 
> copies.  Over time even with a robust backup scheme this will 
> eventually lead to you losing all "good" copies of the file since the 
> backup media will be rotated and ultimately the data will be 
> permanently lost with no means of recovery.
>
> 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?

Artem



More information about the freebsd-fs mailing list