Some simple DDRescue tips?

I will be attempting to copy my failing HDD to a spare drive in order to attempt data recovery.

The current drive has developed a power fault and has now developed the following issue preventing access to the disk:

  • (g) is not accessible, the request can not be performed due to an I/O device error
  • this happens every time I connect the drive in explorer, see the device and try to click into it. Also hangs really bad.

When I do manage to get a data recovery software to scan the drive, it never returns any files. Device also shows up as RAW.

I ran PhotoRec to about 20% after a day or so and it returned no files either. I have been told that DDrescue is my last option, so I downloaded parted magic but am not super confident with Linux or DDrescue, so what im trying to learn is:

What are the commands to start the copy from my faulty hdd to the healthy drive (empty) I also want to skip bad sectors immediately and not bother wasting time trying to read them. If possible, also would like to read the HDD backwards.

ddrescue -f -n -u -R /dev/sda /dev/sdb logfile

Here's how the options break down

  • -f: "Force" option. Required when ddrescue is writing to a device (healthy drive) rather than a file.
  • -n: "No Scrape" option. Avoids deep recovery of bad sectors/file data, which is very useful when doing a single-pass, fast recovery. You can, of course, use the logfile to do a deeper recovery after the first pass is done.
  • -u: "Unidirectional" option. Runs all passes in the same direction, which is relevant to the next switch . . .
  • -R: Will run the recovery backwards as you've said you wanted.
  • /dev/sda: The failing source drive. Before starting the operation, you'll need to make certain that the drive is unmounted (the OS recognizes it, but it's not in an active and browsable state). See below for details.
  • /dev/sdb: The drive you're about to rescue/clone /dev/sda to. Also needs to be unmounted.
  • logfile: The location and name of the logfile that will be generated during ddrescue's run. Consider this to be necessary, even if you don't run any additional passes. It'll allow you to resume recovery where you left off if the process is interrupted.

On drive names and detection

Since Parted Magic runs in a Linux environment, you'll need to be able to ID each drive -- the failing one and the new one -- using Linux command-line tools.
fdisk -l will give you a list of the drives the OS sees and their partition info (if any); e.g., the following shows the info about two recognized drives on my system -- /dev/sda, which has 4 partitions, and /dev/sdf (a thumbdrive), which has 2 partitions. When doing whole-drive recovery, the important info for ddrescue is the Disk name (/dev/sda). The partition information (/dev/sda1, /dev/sda2, etc) is irrelevant:

[[email protected] Downloads]$ fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000d35e8

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048  120002047  120000000  57.2G 83 Linux
/dev/sda2        120002048  360002047  240000000 114.5G 83 Linux
/dev/sda3        360002048 1889521578 1529519531 729.3G 83 Linux
/dev/sda4       1889521579 1953520064   63998486  30.5G 83 Linux

Disk /dev/sdf: 3.7 GiB, 4004511744 bytes, 7821312 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6b87f50d

Device     Boot Start    End Sectors  Size Id Type
/dev/sdf1  *        0 917503  917504  448M  0 Empty
/dev/sdf2         244   8435    8192    4M ef EFI (FAT-12/16/32)

It's been a while since I've used that distro, but Parted Magic shouldn't automatically mount any drives unless you run an operation that requires it (such as trying to browse the drives' contents). To see if anything's been mounted, use the df -l command. Any entries returned that use a partition path for the drives found using fdisk -l will need to be unmounted using the umount command (note the lack of an 'n' after the first 'u') before starting ddrescue:

[[email protected] Downloads]$ df -l
Filesystem      Size  Used Avail Use% Mounted on
dev             7.9G     0  7.9G   0% /dev
run             7.9G  1.2M  7.9G   1% /run
/dev/sda1        57G   14G   40G  26% /
tmpfs           7.9G   16M  7.9G   1% /dev/shm
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
tmpfs           7.9G   60K  7.9G   1% /tmp
/dev/sda2       113G   57G   51G  53% /home
/dev/sda3       718G  227G  455G  34% /media/Storage
tmpfs           1.6G   28K  1.6G   1% /run/user/1000
/dev/sdf1       448M  448M     0 100% /run/media/b/VOID_LIVE

Using the above results, if I wanted to recover /dev/sda to /dev/sdf, I'd need to unmount each of the partitions listed that exist on those drives before starting:

umount /dev/sda1
umount /dev/sda2
umount /dev/sda3
umount /dev/sdf1

One more thing . . .

If you're running a full-drive recovery, you need to make certain that the replacement drive is the exact same size as the source drive.

Hope this helps.

Thank you very much for that detailed reply, however I think that DDRESCUE will not be of any help to me.

I ran the command and the search completed almost instantly and simply returned 0 bytes rescued.

is there anything I can try with testdisk to try and repair the boot table to recover files? Almost every search in various programs return one of the following;

I/O error
Unidentified partition table

Im almost ready to bin the device, so im ready to try some pretty harsh measures.. if anyone has any?