3
The laptop in question has a hard drive that is beginning to have corrupt sectors. It's to the point where Windows won't boot b/c a system file has fallen victim.
I'm sure that the drive needs to be replaced, no point messing with something flaky, but it's a 320GB disk with probably 160GB+ of stuff on it.
What's the best way to save the files that can be saved?
I'm thinking boot a linux live USB stick and work from that, but not sure what 'dd' will do when it hits bad sectors. I want something that will just skip bad sectors, and preferably eliminate the files that contain them. (not sure 'dd' would do that, either)
I'm asking here b/c I don't want to experiment; not sure how many more passes this thing will take before it goes stone cold dead. What's the best way to grab the most complete image of the files that can be read? The ideal method will get the files that can be gotten without re-tries, and then optionally after treating the whole disk, go back and maybe do re-tries to get the files with dubious sectors in them.
interesting - so the output file somehow stores some metadata that says which parts represent bad sectors? Suppose some sectors are just irrevocably lost; does that mean when I mount the image, if I read a file that includes such a sector, the mounted image will 'have the error'? I.e., if there's a corrupt file in the image, will I know it? Hoping the answer to that is 'yes'.. – JustJeff – 2012-08-17T02:13:32.567
The metadata is stored in a log file that you specify. Unfortunately, since dd is a low-level tool, it is not aware of the specific filesystem. You can probably find information about specific bad blocks in the log file, and there are ways to determine which file contains that sector: http://serverfault.com/questions/311270/from-bad-sector-to-damaged-file-did-it-for-linux-ext3-can-i-do-it-for-windo
– user55325 – 2012-08-20T18:49:25.847