DomU filesystem

From VVCWiki
Jump to navigationJump to search

If you created your DomU guest by exporting the whole disk and not partitions, here is how you access it's file system from Dom0:

# fdisk -luC 1 /dev/vg0/xenmike

Disk /dev/vg0/xenmike: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/vg0/xenmike1   *          63      208844      104391   83  Linux
/dev/vg0/xenmike2          208845    19904534     9847845   83  Linux
/dev/vg0/xenmike3        19904535    20948759      522112+  82  Linux swap / Solaris

We want to mount second partition. First calculate offset, we take start value for this partition and multiply it by sector size: 512 * 208845 = 106928640

Now we mount it:

# mount -o loop,offset=106928640 /dev/vg0/xenmike -t ext3 /v
# ls -l /v
total 100
drwxr-xr-x  2 root root  4096 Jun 26 04:04 bin
drwxr-xr-x  2 root root  4096 Jun 25 09:53 boot
drwxr-xr-x  2 root root  4096 Jun 25 09:53 dev
drwxr-xr-x 67 root root  4096 Jul 11 13:48 etc
....