Mount image files

Just had a fight to mount an image file (img) that was generated probably with a dd command… 

The problem is, because it is a plain copy of the whole HD, including bootloader, etc, the usual mounting apps (tried acetoneiso, and others) simply won't work.

Searching a bit for the answer:

(1) Find the linux partition sector of the image:

$ fdisk -l file.img

(2) Mount from that sector

$ mount -o loop,offset=1048576 -t ext3 file.img /mnt/img

where the offset is n*512 (in my case it was the first partition, or 2048, so 2048*512 = 1048576). And you might need to create the directory /mnt/img (or anything else you want).

Voila!

More info:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>