Image of a whole disk. Mounting one of its partitions.
Kernel 2.6.21.5, Slackware 12.0
Hi: I have disk.img, an image of a whole disk, comprising track 0, a FAT32 partition and an ext3 partition. Is it possible to mount one of these partitions? A command like 'mount ./disk.img /mnt -t<some_type> -o loop' will fail, because disk.img should be a filesystem and is not. |
Should be doable by using mount ./disk.img /mnt -t<some_type> -o loop,offset=<some uint> where the offset uint could be found from the partition table?
|
...else try
Code:
losetup -o $[512*offset] /dev/loopn /path/to/disk.img Code:
kpartx -a /path/to/disk.img |
Hi there,
Quote:
But, you're right, that information is in the partition table, which is in the very first sector of the disk image. The actual starting sector for the first partition is the DWORD at offset 01C6h, for the second partition at 01D6h (see Explanation for details). This assumes that you still use traditional partitioning; GPT is a bit more sophisticated. [X] Doc CPU |
Thank you all. A little shortsightedness of mine, so many times in mount manual and not having followed the losetup(8) reference!
I did: Code:
# hexdump -C disk.img |
All times are GMT -5. The time now is 04:30 PM. |