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

Re: [Xen-users] how do I increase a LVM based xen domU?


  • To: "Pasi Kärkkäinen" <pasik@xxxxxx>
  • From: "Rudi Ahlers" <rudiahlers@xxxxxxxxx>
  • Date: Fri, 19 Sep 2008 09:09:33 +0200
  • Cc: xen-users@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 19 Sep 2008 00:10:15 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=g1KKEtlb/SisdhsQ6kw01tsTh+6ZvdrPaMYgkhfxF6A0ZJpWRsvlMZNrBQLcZ8Qkg2 plhCbpmMUFvTH+teWXMYhYWyJxc8e8vkG/NBcCyw2B+5Q/S2LYLuUlNG3VGlslLyGW6F JMMhwJdfFZP2yOmSJWCA56l2iz3P0drqg39Ok=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>



On Thu, Sep 18, 2008 at 9:07 AM, Pasi Kärkkäinen <pasik@xxxxxx> wrote:

>
> Can someone please tell me what commands I need to run to resize the LVM?
>

I assume you have those LVM volumes in dom0.

- lvextend the volume in dom0.
- run "cat /proc/partitions" in domU. Check the size of xvda.
- shutdown domU and start it up again (to pick up the new size for xvda from the extended lvm volume)
- run "cat /proc/partitions" in domU. Verify xvda is bigger now.
- create new partition to xvda, or resize existing partition (you can only grow the last partition easily)

I've come this far, and can add a new partition to the domU, but ideally I'd like to have one partition, since we're installing cPanel (and splitting the data across partitions confuses some people & scripts. )

 

- mkfs.ext3 the new partition or resize2fs the existing partition you just grew by editing the xvda partition table.

If I understand this correctly, this will format the partition, and I will loose all data on it, right?


 

Xen doesn't support online resizing domU xvdX/vbd devices at the moment.
So you need to restart domU to see the new/bigger size for xvdX devices.

That's fine, I don't need online resizing,  I can shutdown the VPS in order to increase the size of it. 

 

You could also run LVM in domU aswell.. to be able to resize any partition/volume in domU more easily.
In this case the procedure would be:

- lvextend the volume in dom0.
- run "cat /proc/partitions" in domU. Check the size of xvda.
- shutdown domU and start it up again (to pick up the new size for xvda from the extended lvm volume)
- run "cat /proc/partitions" in domU. Verify xvda is bigger now.
- resize/grow the LVM PV partition by editing partition table. Remember you can only grow last partition easily.
- reboot domU to make sure new partition sizes are picked up.
- run vgdisplay to check available/free space on your VG.
- run pvresize to resize the LVM PV.
- run vgdisplay to verify you have more free space in your VG now.
- lvextend any domU volume you want to.
- run resize2fs for the volume.

Another option is to have LVM PV directly on say xvdb, without any partition table..
Then you can skip the partition table editing steps.. just a simple reboot
will pick up the new size and you can pvextend immediately after.

How would I setup / install  CentOS (for example) as a VPS in this manner?


-- Pasi



--

Kind Regards
Rudi Ahlers
_______________________________________________
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®.