VMware develops virtualization software. Virtualization software creates an abstraction layer over computer hardware that allows the hardware elements of a single computer— processors, memory, storage, and more— to be divided into multiple virtual computers, commonly called virtual machines (VMs).
Extending LVM disk on VMWARE will help to expand the size of LVM which having low space partition. This is important in cases where you need to allocate more resources.
Here at Outsource Path, as part of our Server Management Services, we regularly help our Customers to perform Linux related tasks.
In this context, we shall look into the steps to extend LVM disk in VMware.
Steps to Extend LVM disk in VMware?
1. Resize Disk in VMware
Do the following;
i. Shutdown the VM.
ii. Right click the VM and select Edit Settings.
iii. Select the hard disk you would like to extend.
iv. On the right side, make the provisioned size as large as you need it.
v. Click OK Power on the VM.
2. Determine the disk
Follow the following steps;
i. Connect to the command line of the Linux VM via the console or putty session
ii. Log in as root
iii. The fdisk command provides disk partitioning functions and using it with the -l switch lists information about your disk partitions.
At the command prompt type;
3. Provoke a re-sync of the kernel
Here find out which SCSI devices are involved:
echo 1 > /sys/class/scsi_device/0:0:0:0/device/rescan echo 1 > /sys/class/scsi_device/2:0:0:0/device/rescan echo 1 > /sys/class/scsi_device/2:0:1:0/device/rescan
In case that doesn’t work you can tell the kernel to re-scan the already known disks only;
ls /sys/class/scsi_host/ echo - - - > /sys/class/scsi_host/host0/scan echo - - - > /sys/class/scsi_host/host1/scan echo - - - > /sys/class/scsi_host/host2/scan
echo 1 > /sys/class/block/sda1/d echo 1 > /sys/class/scsi_device/0:0:0:0/device/block/sda/device/rescan
4. Delete and re-create partition
Now the file system should be resized appropriately.
If you need to rezize the file system: for instance for /dev/sdb fdisk /dev/sdb, simply Delete the existing partition and create a new one with the needed size and quit.
You can then Check the partition integrity. eg. for /dev/sdb1
5. Resize volume group
pvresize /dev/sda2 lvextend -r -l +100%FREE /dev/mapper/centos-root