[Fedora-xen] resizing Xen para-virtualized guest partition

Chris Lalancette clalance at redhat.com
Mon May 7 17:13:55 UTC 2007


runmd wrote:
> 
> I created a para-virtualized guest as 10GB.  Later down the road I would 
> like to grow it to 20GB.   Can I do this with it being just a file on 
> Dom0.  The only possible solution I can think of is creating a new domU 
> as 20GB and then doing a dd command and copying one virutal disk to 
> another.  But I would like to just grow the guest, if possible. 
> 
> Thanks
> Terry
> 

There are two possible ways to do this; both rely on using LVM inside 
the guest to expand the LV.

1)  You should just be able to append data to the end of the disk in the 
dom0 (something like "dd if=/dev/zero count=10G >> 
/var/lib/xen/images/guest.dsk), and use "pvresize", vgextend, lvextend, 
and resize2fs inside the guest to expand the disk.

2)  If you are uncomfortable with the first method, you can define 
another disk and expand your LVM that way.  On the dom0 do something 
like "dd if=/dev/zero of=/var/lib/xen/images/guest-disk2.dsk count=10G", 
then add another line into your /etc/xen/guest configuration file for 
the second disk.  Then boot the guest, and inside the guest partition 
the disk with LVM partition, vgextend the VG with the new partition, and 
finally lvextend the LV with the new space.

If you aren't using LVM inside the guest, the best you are going to get 
away with is adding a second disk (like 2) above), and just mounting 
that inside the guest as another mountpoint.

Chris Lalancette




More information about the Fedora-xen mailing list