Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an external HD that has crashed, and is badly corrupted. I want to copy whatever is intact off of it, which means doing so in Terminal as the Finder will of course give up at the first failure.

It's working fine, but taking FOREVER I think because it tries multiple times for any failure. Also on any failed attempt, I end up with the file being written but with zero bytes. So I suppose my question is two fold:

  1. How can I make the cp command try only once and if it fails, move on?
  2. How can I make the cp command not write a file if it was a failed read attempt?

The command I'm currently using is:

sudo cp -Rfn /Volumes/Audio\ HD /Volumes/Audio\ HD\ 2/recovered 2>> /Volumes/iMac\ Storage/cp_errors.txt

Like I said it does work fine, but I really need to speed it up or this is going to take weeks. It's about 400GB of data to read through made up of many small files (and some large ones).

EDIT: I'm running Mac OSX Mountain Lion (latest version)

share|improve this question
    
did you try with ddrescue? –  Ярослав Рахматуллин Apr 7 '13 at 19:32
    
Doesn't look like it's available for Mac. Am I mistaken? –  Jonathan van Clute Apr 7 '13 at 20:04

2 Answers 2

up vote 1 down vote accepted

well, its probably a litte more complicated than that, so try this algorithm:

  1. take an image of the dying disk using DDRescue, and save the image to another HDD as a file (preferably a very large one).

  2. mount the image in a linux environment, and test it. many of your files may have been repaired by ddrescue

  3. if the partition is not readable, try TestDisk

  4. if the partition is there but many files are still unrecovered, abandon the filesystem, and attempt to extract files with tools like formost, photorec, and magic rescue. these tools cannot recover all kinds of files (file must have a known header/footer pattern), but it can get most common binary formats.

Here is a good place to get info on all the tools involved: https://help.ubuntu.com/community/DataRecovery

http://www.bootmedplus.com/tutorials/image10/ http://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step http://www.cgsecurity.org/wiki/PhotoRec_Step_By_Step http://foremost.sourceforge.net/

share|improve this answer
    
Oh I probably should have mentioned I'm using Mac OSX (latest Mountain Lion). Don't have much experience with Linux outside of that. –  Jonathan van Clute Apr 7 '13 at 20:02
    
that probably makes it harder (I don't know much about mac's FS) but I would not be suprised if there were mac equivalents for all the tools above. I'm sure Testdisk can handle whatever partition type you are using (they've got quite a list), and ddrescue doesn;t care about the underlying filesystem so far as I'm aware. either way, the algorithm is the same, just the tools that change. get an image off the disk before its too late (I've had several drives gasp their last breath during a recovery operation). –  Frank Thomas Apr 7 '13 at 20:15
    
    
Yeah I've been reading that post. I found a Mac binary of DDRescue and am running it now. Will see how it goes... thanks! –  Jonathan van Clute Apr 7 '13 at 20:59
    
Well, DDRescue appears to be getting a good chunk of the data anyway, but definitely not all of it. It's also going to take a very long time, since it's currently averaging about 1.3MB/sec and I have about 450GB of data for it to work through. By my quick math, it's going to take about 4 days! Any suggestions from anyone on how to speed the process, along the lines of my original question #1 maybe (if it's in fact trying more than once currently)? –  Jonathan van Clute Apr 8 '13 at 1:34

You should try some commercial tools (free to test for some days/weeks) like ShirtPocket's SuperDuper! or Bombich's CarbonCopyCloner to backup your files.

To repair bad filesystems Alsoft's DiskWarrior 4 is the best tool (there is no better tool for HFS+ file system repairing). And to rescue data you could also try ProSoft's Data Rescue III.

share|improve this answer
    
I tried CCC as well and it was unable to clone the drive at all. DiskWarrior also was unable to do anything for me other than mount the corrupted filesystem. It could not copy most of the files off and was unable to repair anything at all. If there's no better tool... that's a bit disappointing. But thanks anyway! –  Jonathan van Clute Apr 8 '13 at 21:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.