Indeed, GNU ddrescue is a good choice. Use it e.g. with 10 retries in case of errors:
ddrescue -r 10 -v /dev/faulty_drive /dev/external_drive optional_logfile.log
Note that by using the above command you are going to overwrite all data on your external hard drive.
Perhaps a safer way is to backup the data to an image file on your external hard drive instead:
ddrescue -r 10 -v /dev/faulty_drive /path/to/external/drive/image.file
For this you may need a file system on your external drive that supports file sizes of 2TB or more (e.g. ext2 and ext3 support file sizes up to 2TB whereas ext4, HFS+, or NTFS support even larger file sizes).
Example where /dev/sda
is the faulty drive and /dev/sdb3
is the external partition (ext4) to write the image file to (run all commands as root):
mount /dev/sdb3 /mnt/external ddrescue -r 10 -v /dev/sda /mnt/external/faulty.img /mnt/external/rescue.log umount /mnt/external
Afterwards, if you want to mount specific partitions of your faulty hard drive image file faulty.img
, you have to use corresponding mount offsets or tools like kpartx.
Another example taken from ddrescue infopages to rescue a whole disc /dev/hda
to /dev/hdb
:
First backup all error-free areas:
ddrescue -n /dev/hda /dev/hdb logfile
Then try to recover any bad sectors:
ddrescue -dr3 /dev/hda /dev/hdb logfile