Recover specific files from a damaged hard drive

0

1

I'm trying to recover some 3-5GB of NEF files which were not yet backed up at the time of the crash.

This is a 418GB ext4 partition and when mounted with -o ro,noload I can list the directory where the files are but I get an error if I try to copy them. I'm currently running ddrescue -n --direct --no-trim --sector-size=4096 and while it started reasonably fast, it has since slowed down considerably. After a restart six hours ago, currently the average speed is about 38KB/s. So far it has rescued 7.5GB.

Given the low speed of ddrescue - is there any way to copy only the files that I need? I'm not interested much in the rest of the disk.

Nikolay Yordanov

Posted 2015-04-05T21:30:23.397

Reputation: 121

There might be but honestly it already sounds like the HDD is already on its last leg, I personally, would allow it to finish what it can no matter how long it will take. Even if you restarted now there is a real possibility recovery wouldn't be possible. – Ramhound – 2015-04-06T11:16:30.890

Answers

2

I'll answer my own question, but feel free to post another answer if you have a better idea.

Here is what I did. First, I mounted the partition as read-only:

mount -o ro,noload /dev/sdb6 /badhdd

Then I used find to run ddrescue on each file:

mkdir ~/rescue
mkdir ~/rescue-log
find /badhdd/path/to/directory -type f -name "*.NEF" -exec ddrescue -vvvv -P1 -n --no-trim /badhdd/path/to/directory/{} ~/rescue/{} ~/rescue-log/{} \;

For any files with errors I did:

ddrescue -vvvv -P1 --reverse /badhdd/path/to/directory/{} ~/rescue/{} ~/rescue-log/{}

After 72 hours I have recovered 65 files out of just over 400 with an average size of 10MB. The speed varies a lot - it takes less than 10s to recover some files, while others take 5-6 hours.

This means that if I manage to recover only the files that I actually need, the recovery will take about 18-20 days, as opposed to over 120 for the entire partition.

Nikolay Yordanov

Posted 2015-04-05T21:30:23.397

Reputation: 121

1Interesting approach. I'd also suggest duplicating the copies on a regular basis; something like running watch -n60 cp -vR ~/rescue ~/rescuecopy from within a separate terminal might be a good start. Onto separate physical media would be even better. That way you have an extra copy of what you managed to recover, in case the drive you are recovering onto fails at an inopportunate moment. – a CVn – 2015-04-09T13:55:51.410