Sunday, May 24, 2009
Practical Matters - Recovering Data from a Failing Hard Drive
So off I go to Best Buy. Grab a 500 GB Western Digital hard drive for $89.00, at least half of what the Maxtor likely cost when I bought it two years(?) ago. No wonder these things don't last any more. Set the new drive to slave with the jumper, plug it into the EIDE cable (yes, I'm using PATA), reseat the cable in the primary drive after a bad BIOS check. I decided to try a Bart PE live CD. Both Norton Ghost 8.3 and 11.0 failed. Version 11 at least failed immediately. Version 8.3 attempted to build the partitions on the new drive and then failed late into the second one. Norton always did disappoint when it came to drive recovery. Next, I tried a Linux live CD. I used the old workhorse dd.
dd if=/dev/sda of=/dev/sdb bs=4096k conv=notrunc,noerror,sync.
old drive new drive 4MB chunks don't truncate or stop for errors
I told dd to copy the data from the old drive to the new drive in 4MB chunks without stopping for errors, etc.. It failed after copying 81GB of data. That was new. Usually dd doesn't stop for anything unless the drive is already dead. Time to use ddrescue. I'd known about ddrescue for about 4-5 years, but had never needed to use it. It turned out that there is an improved version, GNU ddrescue, or gddrescue. There's even a version for Macs now.
First, I have to install the program on the live CD:
apt-get install ddrescue gddrescue
ddrescue /dev/sda /dev/sdb
and the recovery was done in about 30 minutes. Normally, one writes ddrescue infile outfile logfile (everything in UNIX/Linux is a file, even devices), but I decided I didn't want to fill up the ramdisk of the live CD in case ddrescue found a lot of errors. It turned out it didn't find any errors.
Last, but not least, set the new drive to master (remove the jumper basically for WD). Take the old drive out and replace it with the new drive, and I have my old system back. I had updated the kernel to 2.6.29 earlier in the morning and VMware Workstation fails to compile new modules, but that's another story. I hope this helps anyone trying to recover a failing hard drive from any system. If you are using an Ubuntu live CD, remember to put sudo in front of your apt-get install command. You may have to run sudo apt-get update prior to the sudo apt-get install. Supposedly, ddrescue will recover data from CDs, but since many audio CDs are copy-protected, a bit-by-bit recovery tool will tend to fail. This is unfair, but what can one do when copyright fair use has been crippled by theft by users and greed by producers. If you can send the drive back for a refund if it's under warranty, use GNU shred on it before you do.
Looks like a close run thing.
Only in this age can there be so much legitimate drama in the near death of our PCs.
They're so much part of us, of our lives, part of the family.
Secretly I confide that my PC is more importannt than my 2 dogs!! There I said it.
My PC is my delicate thread to sanity and intellectual contact outside my sleepy hollow.
I'm sure that you would miss your dogs more than your data. The furry ones are surrogate children and are unique. The data can be recreated or replaced or recovered, but once a pet has died, he or she is gone for all practical purposes. So, enjoy them while you have them.
I really just posted this to save someone a support call of $250 on up, if they didn't backup their data. I'm not sure what I'd do without the Internet, probably read more books.
Links to this post: