0

A fried of mine gave me her laptop because it was behaving wierdly. This was (Still is) a hard drive failure, and I suggested her to backup her files before installing a new hard drive.

I booted the computer with Ubuntu on a flash drive to backup her files (Mainly family picture and movies), but I still struggle to copy the files : when a file is corrupted, the copy function waits for the copy to complete.

Is there a way I can tell the cp function to skip damaged files ? (Maybe telling it to skip files when the copy speed is too low)

If it isn't possible, can you suggest me a tool which may be useful in that peculiar case ?

Thanks in advance.

1 Answers1

2

If you have a spare disk of equal or greater size you could use ddrescue to clone the drive which will attempt to recover good parts during a read error.

WARNING: these are destructive commands, if you get them wrong you could lose data - double check you have the correct drives before you run them.

Assuming /dev/sdf is the failing drive and /dev/sdw is a working drive you can:

sudo ddrescue /dev/sdf --force /dev/sdw

Or to copy it to a file on a mounted drive (assuming the mounted drive is big enough) you can.

sudo ddrescue /dev/sdf /path/to/file.img

Once you have it on a working drive you should be able to mount/copy the files as normal even if some might be corrupted.

Michael Daffin
  • 3,948
  • 1
  • 12
  • 21
  • Thanks, I'll try as soon as i've got the new disk. When you say "destructive", do you mean only for the destination drive ? Or is it also risky for the source drive ? – Marc Brillault Oct 28 '17 at 22:10
  • Definitely for the destination - but if you get the arguments the wrong way around or mix up the drives you can accidentally wipe wrong drive. The risk is only in human error though - executed correctly it will only read from the source drive and otherwise leave it completely intact. – Michael Daffin Oct 28 '17 at 22:43
  • I've got a spare 500Gb HDD, and the disk I'm wanting to recover is 1Tb, but only a few Gb are used (Around 100 - 200 Gb). Will it work ? – Marc Brillault Oct 29 '17 at 16:52