when you present a new LUN or extend a virtual disk in Vmware you need to run some commands in order to increase Linux partition.
in this scenario we are adding a LVM partition to cover the complex scenario but you can use these steps for any other file systems. let’s skip the part where you have added or extended capacity you wanted by presenting a new LUN or extending your VM disk add etc.
first of all check a list of your partitions and their mount point by fdisk -l
now enter fdisk interactive menu by specifying your desired hard disk like sda3
after creating the partition you should specify its type and by pressing L you can see the code list of available partiotions:
we want LVM so type 8e
press w to save all settings and run the following commands
partprobe –s / reboot pvcreate /dev/sdaXXX vgdisplay
vgdisplay shows details of your LVM partition copy its name and then go to next step
in last step to increase linux partition type the commands below and replace all X with your parameters. also note that these lines are for LVM so if you are using other fs you do not need to use these and should change xfs to your preffered type of fs
vgextend vg-nameXX /dev/sdaX pvscan lvextend /dev/mapper/vg-nameXX /dev/sdaX xfs_growfs /dev/vg-nameXX /root
and last but not least you’ve mastered How to increase Linux partition just remember to check if all your configurations are ok by df -h