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