Is it possible to mount a disk image, created with dd, to a directory on a mounted external usb hdd?

Posted by Keeper Hood on Super User See other posts from Super User or by Keeper Hood
Published on 2012-09-04T01:59:03Z Indexed on 2012/09/04 3:40 UTC
Read the original article Hit count: 431

Filed under:
|
|
|
|

I have an image of my home (/dev/sda3) partition, which I've created using the "dd" command.

dd if=/dev/sda3 of=/path/to/disk.img

I've deleted the home partition via gparted in order to enlarge my /dev/root partition. Then I've recreated the /dev/sda3 partition which is smaller in size then the one I've backed up to the image.

I was wondering since I have a 2TB external HDD, could it be possible to mount my backed up image on the external HDD and then copy the files into the /home directory. Since the external HDD would be already in a "mounted state", I'm unsure whether this is a good idea, mounting on a mounted device.

I'm running Slackware 13.37 (64bit).
used ext4 on all the partitions.
resized the root partition with gparted live cd.

I've tried

mount -t ext4 /path/to/disk.img /mng/image -o loop

It gave me an fs error (wrong fs type, bad option, bad superblock on dev/loop/0)

Then i did

dmesg | tail

which outputs:

EXT4-fs (loop0) : bad geometry: block count 29009610 exceeds size of defice (1679229 blocks)

I have no idea what to do, I want to restore my /home data from the image I've backed up.

© Super User or respective owner

Related posts about linux

Related posts about hard-drive