1

I have run ddrescue on a hard disk, and got all data (2 partition) to another disk named part1.img and part2.img. How to proceed to read (list) the files in part2.img? I use fedora 14, 32 bit

Anthon
  • 78,313
  • 42
  • 165
  • 222
ostene
  • 11
  • 1
  • possible duplicate of [How do I mount an \`img\` created with /bin/dd of a hard drive?](http://unix.stackexchange.com/questions/2661/how-do-i-mount-an-img-created-with-bin-dd-of-a-hard-drive) – Matt May 09 '14 at 15:05
  • Sorry.. that deals with a more complex case. I actually can't find a dupe of this. They are all slightly more esoteric. – Matt May 09 '14 at 15:12
  • If you have the partitions (contrary to the whole disk), you should be able to loop mount the partitions in directory: `mkdir part1; mount part1.img part1 -o loop,ro` (read only to prevent breaking something in case there is a problem). – Anthon May 09 '14 at 15:25

1 Answers1

0

To mount a partition image

As root run:

mkdir $mount_path
mount -t $filesystem_type -o loop $image_file $mount_path

In your case this will most likely be

mkdir /mnt/part1
mount -t ext4 -o loop part1.img /mnt/part1

As Anthon suggested you may want to add the ro mount option to prevent anything from changing.

Matt
  • 8,841
  • 1
  • 26
  • 32