Ok, so you're turned your machine on and it won't boot. Maybe you're having a Grub error 17, or a Dell DRIVE ERROR CODE 7 (well that's what happened me anyway) and are desperate to get what's salvageable from your hard drive. These instructions are what I followed when a hard drive failed on my Linux (Ubuntu) box. The steps here may work for other operating systems, but you will need a linux machine to execute the commands below. It should be noted that these instructions did not recover all the data on my hard drive.
Before continuing, take a break, a cup of tea/coffee. You don't want to rush through this, mistakes at this point could be costly. Also, even though it's probably too late for you, I hope you remembered to back up everything so you won't have depend on these instructions. The key thing to note is that although your hard drive is broken, it's possible the data is still salvageable, either by yourself or by a professional. I am *not* a professional, and these instructions are the steps I took to retrieve data from a broken drive. I offer them only as information for the public, if they help you, great, if not, tough luck. There are plenty of other pages on the web with information on hard drive recovery, don't take my word as gospel. Caveat emptor - you have been warned.
OK, ready to continue? First remove the broken hard drive and put it in another, working, Linux machine.
You will need an empty partition at least as big as the one you are trying to save. This partition *must* be empty. We will be overwriting this partition with the data from the one we are trying to save. Anything that was there will be overwritten.
Install dd_rescue. This is a utility that allows you to directly copy the data from one partition to another.
It is important that we get whatever data we can from the broken hard drive. The process of retrieving data may itself make things worse so we want to access the broken hard drive as little as possible to reduce the risk of losing more data. Do not try to fix the partition in situ.
Let's now copy all data from the broken partition to our larger, empty partition on a working disk. If the empty partition we want to move our data to is /dev/hdb7 and the partition whose data we are trying to save is /dev/hda4 execute the following. (N.B. be very careful doing this, if you get these the wrong way around you will lose the data you are trying to save.)
ddrescue /dev/hda4 /dev/hdb7
This task may take several hours to complete. It will look something like this as it runs:
Press Ctrl-C to interrupt rescued: 5340 MB, errsize: 126 kB, current rate: 28770 B/s ipos: 5340 MB, errors: 2, average rate: 17026 B/s opos: 5340 MB Copying data...
At this point, all the recoverable data (by this method) has been copied to the partition /dev/hdb7. In order to see if there is anything useful left we run fsck on this partition (note, we are trying to work from the data saved onto the working disk now):
fsck /dev/hdb7
This process may throw up some errors, e.g.,
Entry 'sunbird' in /joebloggs/.mozilla (4309103) has deleted/unused inode 55221752. Clear<y>?
It's up to you to decide what to do if this happens. Chances are this data is not recoverable by this method. If you really need this data seek help from a professional. Do not continue these instructions as they won't recover that data. (Continuing may retrieve other data though.)
If this step doesn't fail, continue
Mount the new partition, e.g.,
mount /dev/hdb7 /some/mount/directory
Now you should be able to see the filesystem again. It likely won't be perfect, and many files may be damaged but you should try to recover what you can. Hope this was of some use to you. It got me some data back that I thought was lost. Best of luck
After a power surge, my computer shut down and refused to reboot. It kept throwing up a “Grub error 17”. When I did a Dell system diagnostic, the hard drive had an error: “Hard Drive Error Code 7”. Rather than sending the drive to a professional or throwing it out I decided to see if I could restore it. The above page describes what I did to get (most) of my data back (I was lucky).
When I was figuring out how to do this, I used the very helpful instructions on this page. Thanks Vivek