Linux – recover data from a physically damaged hard drive (Windows)

hard drivelinuxwindows

My laptop was recently damaged on the side where the hard drive is located and now I cannot access its Windows partition. I am able to boot into Linux. The hard drive is configured with 2 NTFS partitions – one for the Windows OS and the other for data storage.

Steps I have tried:

  • Mounting the windows partition within Ubuntu. Here I could see my files but it was unable to mount the data partition. It threw an error that it could not recognize the NTFS partition.

  • I attempted to copy the damaged disk onto an external hard drive using the command dd if=/dev/sda of=/dev/sdb conv=noerror,sync but progress stopped at 60% and I was still unable to mount the data partition.

  • I am currently trying to backup my files using an utility called Photorec but it is recovering my files in a disorderly way. When it completes, I see the files but they are all mixed up and I not following my original directory structure.


I ran the ddrescue command last night and it seems to be working but it is running far too slow (1KB/s on average).

How can I get my data back?


I tried freezing the hard drive for a few hours but it didn't increase the speed at which the data was being recovered.
I don't know what can I do now, sending the hard drive to a store specializing in hard drive data recovery would be really expensive from what I heard.
Can anyone give me another homemade solution to recover my disk? Any other program I can use for this purpose? ddrescue is awfully slow… Any help would be really appreciated.

Best Answer

You could try ddrescue:

GNU ddrescue is a data recovery tool. It copies data from one file or block device (hard disc, cdrom, etc) to another, trying hard to rescue data in case of read errors.

A good primer for ddrescue is on the ForensicsWiki. Install it on Ubuntu by running sudo apt-get install gddrescue. Next, you'll recover the partition. Quoting from the article:

First you copy as much data as possible, without retrying or splitting sectors: ddrescue --no-split /dev/hda1 imagefile logfile

Now let it retry previous errors 3 times, using uncached reads: ddrescue --direct --max-retries=3 /dev/hda1 imagefile logfile

If that fails you can try again but retrimmed, so it tries to reread full sectors: ddrescue --direct --retrim --max-retries=3 /dev/hda1 imagefile logfile

The imagefile is going to be as big as the partition you want to recover, so make sure you have plenty of hard drive space (obviously not on the same HD you are recovering from).

Replace /dev/hda1 with the partition (ie /dev/sda2) you are trying to recover. Once you do this, you can mount the imagefile like this:

sudo mount -t ntfs-3g -o loop,ro imagefile /mnt

This mounts the image read-only at the directory /mnt.

Related Question