Daniel Rudolf wrote:
first of all, thank you for your amazing project
You are welcome. :-)
in my experience a broken HDD sometimes doesn't even report a read error, but just returns random garbage.
Interesting. Yours is the third request of a feature intended to detect or recover from such hardware misbehaviors. Are HDD manufacturers cutting too many corners as of lately?
Thus I like running ddrescue at least twice: Once to do the actual data recovery, and at least once more to verify the data that was recovered.
This seems like the best one can do with such faulty HDDs. But I find the hash approach both complicated and inefficient. Comparing the data read during the verification run with the image (outfile) should be better. It would also make easier to use the domain options to verify only a subset of the whole image.
The biggest problems I see with verification are where to store efficiently the different reads of variable sectors, and how to decide which of the reads is the real data of each given sector. Maybe the drive returns garbage most of the time for damaged sectors, and only from time to time it manages to return the correct data.
If the hardware does not fulfil its part of the job (report a read error), it is not possible for the software to be sure that it has got the correct data.
Best regards, Antonio.