[ale] LVM and Xen

Andrew Grieser agrieser at gmail.com
Wed Mar 18 13:54:44 EDT 2009


> When I worked with Xen, it used individual big files on the dom0 
> formatted as filesystems within which the domUs existed.  This made them 
> very portable both within a dom0 and between dom0s.  Have things changed 
> since?

Xen provides two methods of giving a virtual system disk space: exporting a partition (or entire disk), and exporting a local file. The syntax is either phy:/dev/hda1 or file:/path/to/file.

The Xen guides (and default configuration) seem to favor exporting partitions / disks, so that's what I had been using. It seems that local files may be easier to work with though. How do you establish the size and/or grow a file?

> You need to increase the size of the partition before you can increase
> the size of the filesystem. Parted will do this for you and resize the
> filesystem at the same time:

> http://www.gnu.org/software/parted/manual/html_chapter/parted_2.html

The problem is the way Xen handles partitions. For this to work I believe you would have to be within the guest, and the root partition would have to be unmounted.

To the best of my understanding (and please point it out if I am wrong), when you export a partition (or a logical volume) to a guest, the guest sees it as an entire disk. Because the partition you exported does not have a partition table, the guest installer prompts you to create one on what it believes to be the entire disk. So what you end up with is a partition within a partition within a disk. Because of this, you can't manipulate the interior partition from the host (dom0), and you can't unmount the root file system and grow the partition within the guest.

I hope I am just doing this wrong. Perhaps working with files instead of disks will be better.

Andrew


More information about the Ale mailing list