WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: "Pasi Kärkkäinen" <pasik@xxxxxx>
Subject: Re: [Xen-users] how do I increase a LVM based xen domU?
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=IzxOuugO+aAWIo4UfzaOA/f6v1nFBNCzLGxP4k/gqA0=; b=gb05RBiUQFsUUGtMXnhndewTrQM6lRO7w5SPEOz9oQQyBbcOxKvT1MavMgAB04nn4B cg/b0d+HGNsQKxoCBidWKpTfnhXGcjDnWDVCBSafPAx7oq/NJRSVJuPGmmmhGhRlZn3k Zsezxw9dl497vzDKXl62BRyGMynkX4DEkhq7I=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20080918070755.GX13941@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <695200da0809172331h59359967s65506877bfd18ac4@xxxxxxxxxxxxxx> <20080918070755.GX13941@xxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx


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