Thursday, September 25, 2014

linux - Internal hard drive is dying. Is this the right procedure to recover data (with ddrescue)?

As the title says my hard drive is supposedly dying. Two days ago, I powered on my Windows laptop after a week of not using it. After being on it for an hour with no particular problems, I got a BSOD. The BSOD stopped at "Initializing disk for crash dump..." though, and the hard drive usage LED was off, so I decided to shut the laptop off by force. While powering it back on, Windows was really slow at starting up and I couldn't find the dump for the BSOD, obviously.


IIRC it BSOD'd again, and after that I decided to check the troubled drive on my desktop PC as a second HDD. After powering the PC, chkdsk started automatically and since I wasn't in front of the PC I didn't manage to skip it. It completed stages 1 and 2 in 5-10 minutes, then got really slow at 59%, during stage 3, when I decided to power the PC off supposing chkdsk could damage the drive further.


After turning the PC back on something strange happened: no drives were detected in the BIOS, not even the main one. One thing I noticed was that while it was powering on the BIOS was slower at detecting the drives then usual. This leads to my first question:


1) Is it normal for the BIOS to not detect any hard drives at all when one of them is damaged (to the point of not being detected), even though the main drive, the working one, is in a lower SATA port (if this has any relevance)?


After fiddling around with the cables and SATA ports while having the same results, I decide to connect my main drive only. It was detected and everything fine. Then I tried again with both and after a couple of starts with no detection as before, it worked and both were detected at start.


So I logged onto Windows and I desperately tried to copy files from the damaged drive. Accessing it and listing the folders and files took ages, it also froze and crashed explorer for some folders (showing I/O errors). Some files were copied while explorer was not responding. And the files weren't corrupted, but it's a tiny percentage of what I need.


I shut down the PC and removed the hard drive. It was really hot. I haven't touched it since. I thought I needed to understand the problem and decide how to move next. So, second question:


2) Does my hard drive have physical damage?


I must say it looks like it. The heat, the I/O errors, the fact that it doesn't always get detected... The drive is one year old, 500 GB, never had a hit or actual damage. It doesn't make any clicking noises and it sounds normal (I think). It has 3 partitions: System (C:), one with my data, and the Windows recovery one. File system is NTFS.


3) So what I thought of doing was to use ddrescue first, to get an image of the drive. If the image is too damaged I would try buying and using Spinrite, and if that fails I would go for a professional data recovery service. Is this the right way to go?


4) Should I try keeping the hard drive cool while it's working with the tools with some ice packs or fans?


5) What should the file system of the new hard drive, the one that will contain the recovered data, be? ExFAT?


For what concerns ddrescue, since I'm not too familiar with Linux, I had to figure out the right commands for my case. What I came up with was this:


fdisk -l

So let's say the system partition is /dev/sdb1 and data partition is /dev/sdb2, while the new empty drive is /dev/sda1. Then:


mkdir /mnt/recovery
mount /dev/sda1 /mnt/recovery
mkdir /mnt/recovery/recovered
cd /mnt/recovery/recovered
ddrescue -d -v /dev/sdb1 sdb1.img sdb1.log
ddrescue -d -v /dev/sdb2 sdb2.img sdb2.log

6) What would you advise me to do if ddrescue gets really slow? What commands to invoke?


7) After getting an image of the drive what should I try mounting and how? That's the part of the ddrescue process I don't understand.


I hope my post is clear and readable enough. If you need more info, please ask. Thank you in advance.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...