Mounting a xen disk image file on dom0
If you need to get in and edit some files on your xen domU instance, i.e. it isn’t booting up properly, etc, here’s how to mount it on dom0. In this case, we want to mount the second partion on the virtual disk (our root partition):
fdisk -l /path/to/img/file.img
Disk System.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
System.img1 1 4 32098+ 83 Linux
System.img2 * 5 619 4939987+ 83 Linux
System.img3 620 750 1052257+ 82 Linux swap / Solaris
mkdir /mnt/tmpmount mount -o loop,offset=$((512*5) /path/to/img/file.img /mnt/tmp
No responses yet







