Expand Linux Virtual Machine Disk Space

How to Expand Disk Space for LINUX VMware ESXi Virtual Machine

Once space runs out in a LINUX based virtual machine you can easily increase the disk size in VSphere client settings, however to utilize the free space within the LINUX OS requires extending the disk file system.

You can extend the LINUX disk using these basic steps:
Increase the Virtual disk size in VMware settings (reboot)
Create a new PRIMARY partition and set the partition type to LVM (reboot)
Extend the Volume Group
Extend the Logical Volume
Extend the File System
* IMPORTANT NOTE: you can only increase a standard linux server to a maximum of 4 PRIMARY partitions. Most standard LINUX installs create two (2) primary partitions - so this extend method can only be done TWICE!

1) In Vsphere client open the LINUX VM edit settings and increase the disk size. Save.
Reboot the Virtual machine so the LINUX OS can see the increased disk size.

2) Open an SSH or terminal shell to the LINUX server and increase the disk, volume and file system.
fdisk -l
fdisk /dev/sda
type 'p' to list the partitions - note the last BLOCK number of the last partition
type 'n' to create new partition
enter the last partition block number +1 as the start block
accept the default last block number as the end block
type '3' to enter the partition type
type '8e' to select Linux LVM partition type
type 'w' to write the changes
Reboot the virtual machine to access the new partition

Extend the volume group
vgextend VolGroup /dev/sda3

Extend the logical volume and file system in one step
lvextend -l +100%FREE /dev/VolGroup/lv_root --resizefs

Last Updated: 
2018/11/02

Sitemap | Tech Articles | Cordeos News | Tech Notes | IT Support Jobs