Sometimes a friend comes with a crashed harddrive and wants help. If they ask nice I will try to help them. This is one case. First I thought it was a windows problem, but after my recovery the end the drive really died so it was a drive problem
First I tried dd, with sync,noerror option. Everything seemed ok. But it did not transfer enough (I tried to verify with rsync in dry-run mode). I now think dd is not proper tool for this. There are people advocating it. But the problem is that it is not designed for rescuing operations. There are specialized tools for that, that try more than once on failing parts of the drive.
What you need: An empty usb drive at least as big as the failing harddrive. An iso-file of System Rescue Linux CD
Burn the iso file to a CD. On Mac use the Disk tool.
Boot, turn on the computer.
(not needed but if you want: lsusb -v to see usb devices)
fdisk -l to see drives. Find out who is the failing drive and which is the USB drive. Myabe you see the name of the harddrive manufacturer?
Take note of their "location", what is below /dev/ . It could be /dev/hda1 or /dev/sda1 for the failing drive.
You are going to use ddrescue (The gnu version which is not the same as dd_rescue. Known as gddrescue on debian). Reads bad sectors more slowly, should be better than most alternatives.
the command is going to be:
ddrescue infile outfile logfile
But first you will need to know the infile and outfile.
The logfile can be any name.
I suggest: /logfile
It is used by ddrescue if you need to restart it, then it can continue where it was instead of starting over. The logfile will be stored on a RAM-disk when you run the systemrescue CD. What it means is that you do not need to worry about it overwriting any of your data, and that if you turn off the computer the logfile will be gone and you will have to start over.
Note: Make sure you know what is infile and outfile, don't mess up the order.
This is the only command you will need to rescue your drive if you are lucky:
ddrescue -v /dev/sda /dev/sdc /ddrescuelog
However I suggest (see below): ddrescue -v -d -c 10 /dev/sda /dev/sdc /logfile
Note that this is for my example. Don't just use it without knowing which is your hd and which is your usb drive. You need to get infile and outfile right.
Starts good but slows down. The second night it copies less than 2 GB. More than a month left to finish.
ctrl-c then restart with new options -d and -c 10 (suggested by their mailing list)
I didn't notice the speedup at first, but after some hours it had analyzed the full 160GB. Then a new phases started "trimming error areas". And the errsize starts decreasing fom 49464 kb and 1873 errors down to, well after a day 4461 kb and 1933 errors. The errsize is decreasing slowly slowly...
After another day, the errsize is down to 3090kb and errors up to 1974 but the message has changed to "Splitting error areas" so I guess we are close...
Yes! Finished. Rescued 160038 MB errsize 3077kB and 1986 errors.
I turn of the laptop that has been turning me mad with its sound. Ooops, I forgot to verify the copy. It would be interesting to do that with rsync --dry-run. So I turn on the computer, but the HP bios reports: SMART Hard Drive detects imminent failure. Please backup the contents of the harddrive and run HDD self test in F10 setup. OK, but I can't boot into the live-CD because of this message, so I can't backup the contents of the harddrive. And doing the self-test just results in a message that it fails. But how do I get to the live-CD to do my own investigation? I can't.
But when I plug in the USB copy into my Mac and look at the directory with pictures, everything seems ok. Previously I used plain dd with noerror option, and then the pictures looked like they were there but wouldn't open. So my guess is that ddrescue has done its job! Great.
Here is another link if you want to read more.
2009-08-24
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment