# Best way to recover data from a dying HDD?

## luismw

Hi, my main computer has severe HDD problems and is unable to boot from that disk. I'm using the System Rescue CD to mount the failing disk, mount an external USB disk and try to copy over as much data as possible.

But here's the thing: the disk kind of works just after power on, but in a couple of minutes it starts failing again. What I'd like to find is a way to ask the system to back up a whole directory, for instance. It should start copying, until the disk fails. The I would cancel the transfer, shut down, wait for the computer to cool off, boot again and issue this same command so that it continues copying were it left off last time. There are many files I'd like to back up and I can't just "cp" each one manually.

I tried using "rsync --partial --inplace" for this purpose, but it seems that I'm misunderstanding the manual because each time I try it, it copies files that have already been backed up, therefore losing valuable time before the disk starts failing.

Any suggestions are very welcome.

----------

## chiefbag

Sounds like the disk may not be the issue rather a shady power supply or something.

I would remove the drive totally and replace it with a different one, if that one shows up the same problem then its a hardware issue other then the drive.

Also you could put the existing drive into another machine this will prove out the issue also.

In any case your are going to need either another machine or another drive to test.

----------

## destroyedlolo

If chiefbag's test is not successful, it looks like to 2 a problem with the HDD electronics.

So :

- Try to keep it cold 

- if you find an other similare HDD (exactly the same), you can try to swap the electronic card ... but it's very risky : recover the maximum you can before.

Good luck.

----------

## luismw

Thanks for your advice, but my question was more about how to salvage the data. What program can I use (preferably, included in the system rescue CD). 

The computer, by the way, is a Mac, so I'm afraid that opening it up to do anything is not really feasible.

----------

## chiefbag

 *Quote:*   

> The computer, by the way, is a Mac, so I'm afraid that opening it up to do anything is not really feasible

 

Are you planning on just dumping it in a skip so?

Your issue is defiantly relating to hardware at some level so like it or not if you wish to use this machine again you will have to get someone to open it at some stage.

Rsync will do the job fine but as you have already stated the drive keeps dropping after x amount of time.

No software is going to help you in this scenario.

Please do yourself a favour and take the previous advice from this thread  as suggested by both "destroyedlolo" and I.

----------

## cach0rr0

no two ways about it. it has to come open

what you need:

-ziploc bag

-beer cooler full of ice

-external enclosure that does power purely via USB

-long enough USB cord to reach your new machine

not kidding. Recovered data from an old Samsung HDD like this way back when

----------

## luismw

Opening the Mac up is, right now, out of the question. Sorry if I'm not explaining myself: I'm not asking for ways to repair or recover the disk. I'm only asking for the correct flags for rsync or any other suitable program to be able to recover the data. I'm simply asking: Is there a program that can copy over some data from one place to the other, and is also able to resume after canceling just were it left off? And if there is such program (rsync looks like it), what flags should I use?

Don't take me wrong, I don't plan to somehow get the data out and then throw the computer away. But for the time being I'd love to have a straight answer to my question.

Thanks for your advice, anyway, it will come in handy, but right now my question is more specific.

----------

## chiefbag

From 

```
man rsync
```

 *Quote:*   

>        Perhaps the best way to explain the syntax is with some examples:
> 
>               rsync -t *.c foo:src/
> 
>        This would transfer all files matching the pattern *.c from the current directory to the directory src on the machine foo.  If
> ...

 

----------

## drescherjm

 *Quote:*   

> Sounds like the disk may not be the issue rather a shady power supply or something. 

 

I see this happen a lot with seagate drives at work where I have 200+ drives. Sometimes you hit a URE (unrecoverable read error) and the drive totally goes offline. In the last 2 weeks I have had that happen to 2 different 750 GB 7200.10s. 

I recommend using ddrescue with the log option. However it may help to look at the SMART data first to see if this is indeed the problem.

----------

## chithanh

dd supports the seek= and skip= and count= options. So if the drive works for a given amount of time, run dd in a for loop, copying 100MB (or so) at a time and note which iteration fails.

Then on next power cycle, start the copy after the last successful iteration.

Also you may be able to spin down the drive using hdparm to let it cool off and avoid a power cycle.

----------

## s_bernstein

I would probably try to use rsync -av <old_disc_mount_point> <new_disc_mount_point> because dd is a rather lengthy process. Also, rsync should be able to resume automatically and you can restrict it to specified a directory - like /home. So you can save your important data first - just in case your hdd is failing completely before you were able to recover all data.

----------

## drescherjm

One reason why I prefer dd_rescue over copying the files 1 by 1 using whatever method is speed. I mean dd/dd_rescue will be block by block at the hard drives fastest speed which is typically > 100 MB/s. While copying files 1 by 1 will be much slower if you have many small files (lots of hard drive seeks). However rsync will definitely be faster if your disk is nearly empty and with rsync you can pick the most important files first.

----------

