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.

my external hard disk (or, more specifically, the hard disk of a friend of mine) is failing, of course there is no backup.

I'm looking for a tool that tries to rescue the most possible amount of files in specific directories.

Previously, I've done this kind of things with dd_rescue, but there are only 50GB used on this 500GB disk, and I don't want to make a complete image of the partition, because I don't have enough free space on the other disk.

So I am looking for a robust tool/script that recursivly tries to copy files/directories, retries n times and skips if not possible.

One thing a have come across is Unstoppable Copier ( http://www.roadkil.net/program.php?ProgramID=29 ). It is good, but not so robust, and on linux uses Qt which I don't have on the command line.

There must be some kind of linux tool/script! Can you help me? Thanks!

share|improve this question

3 Answers 3

You could try use dd_rescue along with find with something like:

# start where you need to rescue things from
cd /place/bad/drive/is/mounted

# create directory structure to try restore to
mkdir -f /path/to/place/to/try/restore/to/ 
find . -type d -exec mkdir -f /path/to/place/to/try/restore/to/{} \; 

# find all files and try rescue them
find . -type f -exec dd_rescue {} /path/to/place/to/try/restore/to/{} \; 

Note: I've not tested the above, so try it over a small dataset first to make sure the output is as desired before trying it on a set of files that could take ages to process. And make sure the drive to be rescued is mounted read-only for paranoia's sake.

Also this will not cope well if the directory structure is affected by the bad condition of the drive, as the find steps will not retry on error like the dd_rescue parts will - so you might have to go with the dd_rescue-the-whole-partition-and-pluck-files-from-the-rescued-image-afterwards option unless the directory structure is "safe".

share|improve this answer
    
thanks, this is a good answer, will try. but i don't understand the 6th line of your code with "dd_rescue mkdir -f" in it. typo? or do you want dd_rescue to make dirs? i also asked myself if there wasn't an all-in-one tool that accomplishes my desired tast. –  ernesto che Jul 2 '10 at 12:34
    
@ernesto: that was a typo on my part (well, a copy-paste-o). I've edited the answer to correct. That line finds all directories in the source area and used mkdir to replicate that structure in the destination area. If all the files are in the root (no sub-directories) then you do not need this step. –  David Spillett Jul 2 '10 at 13:10

Drag and drop with your file browser?

Its honestly that simple. If you want to be more advanced you can search for all, for example, doc files then drag and drop them.

You want to watch out though with paralleling file transfer's, the more you do the slower it can get and the more risk of you drive dying and you only have a bunch of partial files.

share|improve this answer
    
doesn't work. windows explorer just freezes. nautilus also freezes or reports an error. even if it copies a file, it just aborts on an error. –  ernesto che Jul 2 '10 at 12:02

The suggestion from David Spillett is the closest one to what you need, but keep in mind that for many failing disks, it is a different - and more difficult! - matter to seek around (which will happen when you read files from the filesystem)...

Reading sectors from beginning to end with no seek involved (i.e. dd if=/dev/sda of=/path/to/rescue bs=...) has worked for me in the past, providing all the disk content, when seeking around via the filesystem trying to read files failed consistently with DMA errors...

share|improve this answer

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.