Extend root Partition Centos


When you created a 200GB disk in Centos and after logged in you will only see small partition which is default allocated. This article will tell you how to extend it to the required size. In this example I created a 200G disk but inside the machine i can see only 8G

fdisk /dev/vda

Create a new Partition using above command. And the following picture will guide you to do it Partiton the Disk

Once you Done with the Partition, enter the following Command. This command will tell the Operating System about the changes in the Partition Table.

 partprobe /dev/vda
 partprobe /dev/vda3

Create a Physical Volume using following

pvcreate /dev/vda3

Now extend the Volume

vgextend centos /dev/vda3

Extend the Logical Volume to full size

lvextend -l 100%FREE /dev/centos/root

Now Extend your /root

xfs_growfs /

After this, you can see your partition is Extended to 100%