If you extend the size of a Virtual Machine (e.g. VMWare) hosting CentOS, you need to tell CentOS to use the additional space.
Check the existing partition table
[root@test ~]# fdisk -l /dev/sda
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d30cf
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 13055 104344576 8e Linux LVM
/dev/sda3 13055 26109 104857600 83 Linux
Add a new partition
[root@test ~]# fdisk /dev/sda
n {new partition}
p {primary partition}
4 {partition number}
t {change partition id}
8e {Linux LVM partition}
w
Reboot
[root@test ~]# reboot
Check the new partition table
[root@test ~]# fdisk -l /dev/sda
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d30cf
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 13055 104344576 8e Linux LVM
/dev/sda3 13055 26109 104857600 83 Linux
/dev/sda4 26109 39162 104853565 8e Linux LVM
Create a new physical volume from the new partition
[root@test ~]# pvcreate /dev/sda4
Extend the existing volume group
[root@test ~]# vgextend vg_test /dev/sda4
NB: The volume group name is given by lvdisplay:
[root@test ~]# lvdisplay
--- Logical volume ---
LV Name /dev/vg_test/lv_root
VG Name vg_test
LV UUID wkJfwT-hJkJ-fQCL-HTqP-0ZrZ-i8vL-TrLTif
LV Write Access read/write
LV Status available
# open 1
LV Size 149.99 GiB
Current LE 38398
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
...
Extend the logical volume
[root@test ~]# lvextend /dev/vg_test/lv_home /dev/sda4
Resize the filesystem in the logical volume
[root@test ~]# resize2fs /dev/vg_test/lv_home
Check that the new space has ben taken into account
[root@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_test-lv_root
148G 6.4G 134G 5% /
tmpfs 1002M 0 1002M 0% /dev/shm
/dev/sda1 485M 68M 392M 15% /boot
/dev/mapper/vg_test-lv_home
144G 5.0G 132G 4% /home
[root@test ~]#