[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] expanding Xen guest disk size


  • To: Xen User-List <xen-users@xxxxxxxxxxxxxxxxxxx>
  • From: "Fajar A. Nugraha" <list@xxxxxxxxx>
  • Date: Mon, 13 Jun 2011 14:48:51 +0700
  • Delivery-date: Mon, 13 Jun 2011 00:50:09 -0700
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

On Mon, Jun 13, 2011 at 4:49 AM, Simon Hobson <linux@xxxxxxxxxxxxxxxx> wrote:
> sylvan.dcunha@xxxxxxxxx wrote:
>
>> I have been using Xen on centos and its been working grt..
>> I have 3 VM guest OS running on Xen under Centos 5.5
>>  ...
>> Now I recently ran into a problem that my centos guest VM and windows 2003
>> and slowly running out of space.
>
> You don't state what type of storage you use for the guest volumes, but the
> process is very similar for all of the options.
>
> 1) Enlarge the (virtual) block device. If it's a file based volume then you
> need to extend the file, if it's a partition then it's going to be hard, if
> it's on LVM then just do an lvextend on it.

Be VERY careful if you're using file-backed domU storage. Most howtos
involve using dd. If you do it wrong, you might end up destroying the
file image. So better have a copy of the disk image before doing
anything. If you don't like using dd, try "man truncate"

Also, for reference, extending the file image is only possible if the
image is raw (the default format on Centos' Xen). qemu and vhd format
can't be resized easily, and the "resize" process for these type of
images is basically create a new, larger, disk image and copy the old
content.

>
> 2) Signal the guest to notice the change in block size. I understand that
> there is a process whereby you can tell the guest to re-read this, but I've
> never done it.

IIRC this is only supported on newer versions of Xen, and only for PV
Linux domUs. Centos doesn't have this feature.

> A sure way is to stop it and restart it - just restarting
> isn't enough.

Yup.

>
> 3) Resize the filesystem using the appropriate tools.
>
> There are quite a few variations, which is right for you depends on you you
> have things set up. It may well be easier to just stop the guest, and resize
> the filesystem in Dom0 - this has the advantage that you don't need to
> persuade the guest to unmount the filesystem if online expand isn't
> supported.
>
> Also, if you have partitioned the virtual device in the guest then you'll
> need to fiddle with the partitions on the resized virtual device - that is
> more work than just expanding a filesystem built straight on the device.

If you use HVM domU (e.g Windows), and domU OS is installed on a
partition, it might be easier to boot using some kind of livecd with
gparted (e.g. gparted live, systemrescuecd, etc.) and use the GUI to
resize the partition.

Note however that default Centos installation use LVM on domU side. In
this case it's MUCH easier to simply add NEW disk image, and use LVM
on domU (vgextend, lvextend) to grow the VG and LV.

-- 
Fajar

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.