How to Extend LVM On Linux sever

[Total: 4    Average: 5/5]

Here, we are going to see How to Extend LVM On Linux sever. we can reduce or extend the partitions in Logical volume management (LVM) also called as flexible volume file-system

Resize in VMM

1.Shutdown the VDS
 2.Right click on the VDS in VMM and select Properties
 3.Under Hardware Configuration | Bus Configuration
 4.Select the Primary HDD
 5.Check the Expand virtual hard disk (GB): box and increase the size appropriately
 6.Click OK
 7.Power On VDS

Resize in CentOS

 fdisk -l

Check top line has correct disk size:
Disk /dev/sda: 129.5 GB

fdisk /dev/sda

Create partition : n
primary : p
partition number : 3
First cylinder default
Last cylinder default

Command p for print
you should see “/dev/sda3

Command t for type
Partition number 3
Hex code 8e for LVM

Command p for print
you should see “/dev/sda3” is now Linux LVM

Command w for write

Ignore the following
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

Then run the following commands

#pvcreate /dev/sda3
 #vgdisplay VolGroup
 #vgextend VolGroup /dev/sda3
 #lvextend -l +100%FREE /dev/VolGroup/lv_root
 #resize2fs /dev/VolGroup/lv_root

Done 🙂