If this is an image of a whole hard drive or as in your case this might be an image of an extended partition, you will need to know the partition layout and the offsets of each partition in the file to be able to mount them.
To do this you will need the parted
tool, you can install it with the following command:
apt-get install parted
After installing parted
, start it with the path to your image file. A parted
prompt will be shown:
$ parted /path/to/image/file/sda5.img
GNU Parted 2.3
.....
(parted)
In this prompt (prefixed with (parted)
) type the following commands:
(parted) unit B
(parted) print
.....
Number Start End Size Type File system Flags
1 1048576B 1573912575B 1572864000B primary ntfs boot
2 1573912576B 156774694911B 155200782336B primary ntfs
3 156774694912B 171454758911B 14680064000B primary ntfs
4 171454758912B 180044693503B 8589934592B primary
(parted) q
The table in the output will tell you the offsets of each partition in the file and the filesystem type in each partition. For example to mount the first partition in the exemplary output above you will need to enter following command:
sudo mount -o loop,ro,offset=1048576 /path/to/image/file/sda5.img /mnt/partition
Make sure that /mnt/partition
exists first.