I restored the hard drive using dd_rescue , which provides me with a list of all device sectors that it could not copy due to hardware errors.
I would like to take this list and write a tool to give me all the files containing these bad sectors so that I can delete them. I'm not sure which APIs I can use for this - in fact, I want to get a list of all the files on the disk and for each file, a list of the range of sectors that it occupies on the disk.
First of all, I assume that I will iterate over each directory entry on the disk and check if one of these damaged sectors overlaps the file. Maybe the best way.
source
share