Tuesday, October 15, 2013

Extending LVM partition on my VMware guest

/dev/mapper/VolGroup00-LogVol00
                      19172036  16489208   1693236  91% /
/dev/sda1               101086     16303     79564  18% /boot
tmpfs                   521396         0    521396   0% /dev/shm
-----------------------------------------------------------------

So I have some space left due to "thin" provision for my VMware guest. I created the physical drive(/dev/sdb3) by fdisk and then added to the existing LVM as follow:


[root@php-bob ~]# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
[root@php-bob ~]# vgextend VolGroup00 /dev/sda3
  Volume group "VolGroup00" successfully extended
[root@php-bob ~]# lvextend -L+25G /dev/VolGroup00/LogVol00
  Extending logical volume LogVol00 to 43.88 GB
  Logical volume LogVol00 successfully resized
[root@php-bob ~]# resize2fs /dev/VolGroup00/LogVol00
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol00 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol00 to 11501568 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol00 is now 11501568 blocks long.

--------------------------------------------

/dev/mapper/VolGroup00-LogVol00
                      44565560  16497340  25768228  40% /
/dev/sda1               101086     16303     79564  18% /boot
tmpfs                   521396         0    521396   0% /dev/shm