3

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!

3 Answers 3

2

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".

2
  • 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. Jul 2, 2010 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. Jul 2, 2010 at 13:10
3

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...

0

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.

1
  • 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. Jul 2, 2010 at 12:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .