I assume that it's true what Bruce said - that it contains whole partition table. Then there isn't anything unusable in that. For the following command you need util-linux
in version 2.21 or higher.
sudo losetup --find --show -P minix203.img
That should attach your image to a loopback device and show you which loop device the image is attached to (eg. /dev/loop0
). Assuming that, fdisk -l /dev/loop0
should show you the partition table and device names for you to be able to mount those. So you'll end up with something like:
sudo mount /dev/loop0p1 -t minix /mnt/myminix
Should work. Note that loop
option is gone, losetup
takes care of that part.
However, if you happen to not have util-linux
package in right version, you can do this manually using fdisk
and losetup
(or better - install the package from external source). You'll just have to do some calculations in that case. First thing is to attach the image of whole drive:
sudo losetup --find --show part.img
That should tell you the device name - let's assume it's /dev/loop0
. Then, try fdisk -l
on it to get the partition layout:
fdisk -l /dev/loop0
For my file I get output like this:
Disk /dev/loop0: 67 MB, 67108864 bytes, 131072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2645940b
Device Boot Start End Blocks Id System
/dev/loop0p1 2048 63487 30720 83 Linux
/dev/loop0p2 63488 131071 33792 83 Linux
Don't get deceived, these might not be existent device names. You'll have to determine which partition do you want to mount using this table. Size or filesystem type should let you make some assumptions.
Now it's calculation time - you'll need an offset of your partition and it's size. You get that by multiplying sector sizes by unit size, to get result in bytes. You can see fdisk
tells me that my sector size is 512 bytes, so if I want to mount /dev/loop0p1
, it starts at (2048 * 512)-th byte. That is the offset and it's equal to 1048576 (in case of that example of course).
Size in sectors is end_sector_number - start_sector_number + 1
, because these numbers are inclusive (end sector is within that size). Here it equals 61440 sectors == 31457280 bytes. That's what we needed.
You can detach loopback device now and reattach it limiting it's size constraints to the particular partition you'd like to mount (substite those numbers with your own):
sudo loopback -d /dev/loop0
sudo loopback -f --show -o 1048576 --sizelimit 31457280 part.img
It will probably attach it to /dev/loop0
, which you can now safely mount:
mount -t minix /dev/loop0 /mnt/myminix
That should be almost fully operational, except for things that would normally affect the MBR of whole drive (like formatting with mkfs).
How does it work?
MBR partition table has a simple layout - there's 512 bytes of description first, where do partitions start, where they end, and then goes the data. With extended partitions it might be a little more difficult. You can set limits to your partition manually and that's kind of what kernel does for you on it's own, for your regular hard disk drives.