[ale] LVM and Xen

Andrew Grieser agrieser at gmail.com
Wed Mar 18 19:55:28 EDT 2009


> It boils down to doing the following from dom0
> 
> 1) run lvextend on your logical volume
> 2) point fdisk to your logical volume, delete the last partition, and
> recreate it with the larger size
> 3) run kpartx on your logical volume to create devices for the
> partitions on it
> 4) run resize2fs on the device created at step 3 which represents the
> partition you're expanding

Ah. Thanks, that worked. Still, it's a bummer that only the last partition can be extended.


> I would imagine it would be possible to map your LVM volumes or disk
> images to entire disks, you certainly don't have to.
> 
> My Xen machines all have LVs mapped to partitions in their config files.
>    That's the way the xen-create-image set them up for me.  It does a
> fine job of creating the LVs and config files for you

I installed the xen-tools package (to get xen-create-image), and all worked like you said. The "guest" (domU) partitions are directly mapped to logical volumes in the host (dom0). Extending them is now as easy as logging into the host, extending the logical-volume, shutting down the guest, running resize2fs, and then starting the guest back up. Xen-tools is a pretty slick collection of scripts, it even caches all the downloaded debs.

I'm still wondering why VM's installed via xen-create-image are able to mount logical volumes as partitions directly, whereas guests installed via 'xm create' are not. I tried borrowing sections of the config file generated by xen-create-image, but couldn't get it to work.

Andrew


More information about the Ale mailing list