Mounting images that contain only one partition is rather easy. But how to mount image with multiple partitions? kpartx
is the solution!
You can list all partitions within the image with
# fdisk -l /vm/dhcpd.img Disk /vm/dhcpd.img: 0 MB, 0 bytes 255 heads, 63 sectors/track, 0 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /vm/dhcpd.img1 * 1 127 1020096 83 Linux
kpartx
can be used to create maps from the block devices
kpartx -a /path/to/xen/image.img
And those maps can be mounted as usual
mount -o rw /dev/mapper/loop0p1 /mnt/
Pingback: xentutorial.com