Mount a Bochs disk image
We can mount a bochs disk image from Linx with the following command:
sudo mount -t msdos -o loop,offset=32256 disk.img /mnt/bochs/
The offset of 32256 is correct if the image was created with the Bochs Disk Image Creator, but how can the offset be calculated?
sudo fdisk -l -u disk.img Disk disk.img: 99.9 MiB, 104767488 bytes, 204624 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 Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type disk.img1 * 63 204623 204561 99.9M 6 FAT16
This shows us that the partition starts at the 63rd block. Each sector is 512 bytes, giving an offset of 512 * 63 or 32256 bytes.
More information
http://bochs.sourceforge.net/doc/docbook/user/loop-device-usage.html
https://www.redhat.com/archives/bochs-developers/1999-February/msg00018.html
http://www.julienlecomte.net/blog/2007/07/3/index.html
Trackbacks
The author does not allow comments to this entry
Comments
Display comments as Linear | Threaded