Best way to backup a laptop with a failing hard drive?

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.

JustJeff

Posted 2012-08-16T01:47:54.760

Reputation: 575

Answers

4

The tool you are looking for is GNU ddrescue. It's like dd, but each subsequent time you run it on the same output file, it will try to fill in any missing data.

Here are the homepage and documentation.

It should be available on most common systems (in the repo, if not on the disk).

I don't know of any such program that operates at the filesystem level.

user55325

Posted 2012-08-16T01:47:54.760

Reputation: 4 693

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

4

Use a drive image software, image the hard drive, then mount the image and work with that, most image software can be configured to skip unreadable/bad sectors, making the image process as short as possible and continue to the end uninterrupted. This will be the least stress on the hard drive, which may not have much time left before total failure.

Moab

Posted 2012-08-16T01:47:54.760

Reputation: 54 203