Can Partition images (.img), directly mounted under Linux

Can partition images like nandc.img uImage are file system, can this mounted directly in Linux? mount command? Data inside image file can be viewed?

Appreciated Thanks,


Solution 1:

If it's a raw partition image like dd then mounting is simple, basically

# mount -t fstype -o loop,ro image.dd /mntpoint

The -t fstype may be optional, it'll be vfat or ext3 or whatever the partition is, sometimes mount can figure it out on it's own so try leaving it out first. And ro means read-only.

If it's a multi-partition disk image that's a little trickier, then use kpartx and it creates mappings for each partition which you then mount.

See http://www.forensicswiki.org/wiki/Mounting_Disk_Images for more info, examples, etc.

But, if you're referring to something like a Das U-Boot bootloader embedded system image, that might need tools like dd and the u-boot-tools package's mkimage to extract the filesystem (if there is one) and then mount it. It's rather involved, see this link for info: http://www.isysop.com/unpacking-and-repacking-u-boot-uimage-files/

Solution 2:

mount -o ro,loop,offset=32256 nandc.img nandc