Increasing CentOS LVM under VMWare

Background: I had an existing CentOS machine as a virtual machine running on VMWare ESX Server and it was running out of space so for future reference I did the following. Incidentally my disk is sda with the new partition create on the extra space as sda3.

I first increased the disk using the vSphere Client:

Increasing the disk size in VMWare

Then on the actual host (‘myhost’ in this example) I checked the existing partitions:

I then ran fdisk on the disk to create a new partition (‘n’) as primary partition 3 (change as necessary).

I printed the partition table (see below) and could see the new partition

But I need the partition type to be 8e Linux LVM so…

Printing the partition table shows me what I wanted.

And save the changes (be careful!)

So reboot.

And now for the LVM commands. Scan the Physical Volumes:

And Create a new Physical Volume from /dev/sda3

Extend the Volume Group 00 to include /dev/sda3:

Scan again and we can see /dev/sda3 included:

Now extend the Logical Volume to extend (-L) the logical volume size by adding (+) 84 GigaBytes:

And now just to  extend the ext3 filesystem to take account of that extra space.

Check that it worked and is now bigger.

Happy days.

10 Responses to “Increasing CentOS LVM under VMWare”

  1. Jens

    Hi,

    instead of adding an additional partition, you can delete the lvm partition and re-created it (of course in the same fdisk session 🙂 ). Save the changes and reboot.

    After that you execute the following commands
    * “pvresize /dev/
    * lvextend -l +100%FREE /dev//

    and last but not least the resize2fs on the lv and thats it 🙂

    Reply

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">