[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6. A small tutorial with examples
Ddrescue is like any other power tool. You need to understand what it does, and you need to understand some things about the machines it does those things to, in order to use it safely.
A failing drive tends to develop more and more errors as time passes. Because of this, you should rescue the data from a drive as soon as you notice the first error.
IMPORTANT! Always use a logfile unless you know you won't need it. Without a logfile, ddrescue can't resume a rescue, only reinitiate it.
IMPORTANT! Never try to rescue a r/w mounted partition. The resulting copy may be useless.
You should make a copy of the failing drive with ddrescue, and then try to repair the copy. If your data is really important, use the first copy as a master for a second copy, and try to repair the second copy. If something goes wrong, you have the master intact to try again.
IMPORTANT! Never try to repair a file system on a drive with I/O errors; you will probably lose even more data.
If you are trying to rescue a whole partition, first repair the copy with e2fsck or some other tool appropiate for the type of partition you are trying to rescue, then mount the repaired copy somewhere and try to recover the files in it.
If the drive is so damaged that the file system in the rescued partition can't be repaired or mounted, you will have to browse the rescued data with an hex editor and extract the desired parts by hand or use a file recovery tool like photorec.
If the partition table is damaged, you may try to rescue the whole disc, then try to repair the partition table and the partitions on the copy.
If the damaged drive is not listed in /dev, then you cannot rescue it. At least not with ddrescue.
Example 1: Rescue a whole disc with two ext2 partitions in /dev/hda to
/dev/hdb
Note: you do not need to partition /dev/hdb beforehand.
ddrescue -n /dev/hda /dev/hdb logfile ddrescue -dr3 /dev/hda /dev/hdb logfile fdisk /dev/hdb e2fsck -v -f /dev/hdb1 e2fsck -v -f /dev/hdb2 |
Example 2: Rescue an ext2 partition in /dev/hda2 to /dev/hdb2
Note: you need to create the hdb2 partition with fdisk first. hdb2
should be of appropiate type and size.
ddrescue -n /dev/hda2 /dev/hdb2 logfile ddrescue -d -r3 /dev/hda2 /dev/hdb2 logfile e2fsck -v -f /dev/hdb2 mount -t ext2 -o ro /dev/hdb2 /mnt read files from /mnt |
Example 3: Rescue a CD-ROM in /dev/cdrom
ddrescue -n -b2048 /dev/cdrom cdimage logfile ddrescue -d -b2048 /dev/cdrom cdimage logfile write cdimage to a blank CD-ROM |
Example 4: While rescuing the whole drive /dev/hda to /dev/hdb, /dev/hdb fails and you have to rescue data to a third drive, /dev/hdc
ddrescue -n /dev/hda /dev/hdb logfile1 <-- /dev/hdb fails here ddrescue -m logfile1 /dev/hdb /dev/hdc logfile2 ddrescue -n /dev/hda /dev/hdc logfile2 ddrescue -dr3 /dev/hda /dev/hdc logfile2 |
Example 5: While rescuing the whole drive /dev/hda to /dev/hdb, /dev/hda stops responding and disappears from /dev
ddrescue -n /dev/hda /dev/hdb logfile <-- /dev/hda fails here (restart /dev/hda or reboot computer as many times as needed) ddrescue -nT /dev/hda /dev/hdb logfile ddrescue -dr3 /dev/hda /dev/hdb logfile |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |