0

I’ve managed to use ddrescue to create an img file of my dead HDD. 690GB. How can I now attempt to recover data from the .img in Linux?

Is there a way to mount it or some tools that auto recover data from it?

2

You can easily convert the image into a block device which will act like a raw hard drive by using the following commands:

losetup loop0 /path/to/imagefile.img

This will create a device "/dev/loop0" which is equivalent to /dev/sda. You can then use

kpartx -a /dev/loop0 

To create partitions which existed on the drive - note that the partitions will exist in /dev/mapper/loop0pX rather then /dev/loop0

If these are regular partitions you can then mount them with the regular mount command like mount /dev/mapper/loop0p1 /path/to/mount - or you can activate LVM using the appropriate LVM commands etc.

0

there are several ways to recover data from an img-file:


The Sleuth Kit

with The Sleuth Kit you can recover/extract files from an img-file directly.

  1. install it by opening a terminal and insert (assuming you are using a debian-derivate):
    sudo apt update && sudo apt install sleuthkit
  2. extracting files and saving them in a choosen folder:
    tsk_recover -a path/to/ddrescue.img /path/to/folder/for/recovered/files

tsk_recover has some other useful options, so i would advise to read its man-page.


kpartx

with kpartx you can mount the img-file and cherry-pick the needed files with your preferred file-manager, which maybe will need much less space and time if you just need a few files.

  1. install it by opening a terminal and insert (assuming you are using a debian-derivate):
    sudo apt update && sudo apt install kpartx
  2. mounting all partitions present in the img-file:
    sudo kpartx -a path/to/ddrescue.img
  3. unmounting all partitions present in the img-file:
    sudo kpartx -d path/to/ddrescue.img

mount

(for this case) pretty the same as with kpartx can be achieved with mount.

  1. mounting all partitions present in the img-file:
    sudo mount -o loop path/to/ddrescue.img /media/loop_mount
  2. unmounting all partitions present in the img-file:
    sudo umount /media/loop_mount

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.