[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Salvage partial reads

From: Scott Dwyer
Subject: Re: Salvage partial reads
Date: Tue, 7 Jan 2020 19:12:43 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

I would like to respond to this with the fact that there is no way to verify that the data up to the bad sector is valid. You would be taking a chance in assuming that the data is good. You are trying to do something that is not within the scope of the capability of ddrescue.

On 1/7/2020 9:39 AM, Eliyahu Saks wrote:

On linux, reads to a block device that fail on a sector return a
failure for the *entire* read, as if no bytes were read, and the location
of the exact sector that failed is not provided. [You can test this out,
and it's also apparent from reading the kernel source code.]

However, when doing a direct read, the good sectors up until the read error
are actually transferred to the userspace buffer, even though read()
returns -1.

Perhaps you could implement a 'paranoid' mode that prewrites known data to
the read buffer before each read. On an I/O error, it can see how many
'sectors' no longer match the original data and assume that those sectors
were correctly read, and mark the following sector as a 'bad sector'. It
would be possible to write a routine to check for the correctness/validity
of this method vs. a specific drive one a known bad sector is found.


Eli Saks

reply via email to

[Prev in Thread] Current Thread [Next in Thread]