PBX Platforms -How to Increase VMware VM Disk Size
Overview:
This guide applies only to FreePBX/PBXact V16 systems. It explains how to safely increase the virtual disk size of a FreePBX or PBXact virtual machine running on VMware, and how to extend the LVM volume group (SangomaVG-root) to utilize the newly added space.
Proceed with caution when increasing volume sizes. Mistakes during this process can lead to filesystem corruption.
Always create a full backup or VM snapshot before attempting any disk resizing.
Step 1: Expand the Virtual Disk in VMware
Power off the VM (optional but safer).
In VMware Workstation or vSphere/ESXi:
Right-click the VM and go to Edit Settings.
Select the hard disk (e.g., Hard disk 1).
Increase the disk size to your desired value (e.g., from 60 GB to 100 GB).
Click OK to save.
Power on the VM.
Step 2: Rescan the Disk
After booting into FreePBX:
sudo echo 1 > /sys/class/block/sda/device/rescanThese commands help the OS detect the new disk size without rebooting.
Verify the new disk size:
lsblkLook for the total size of /dev/sda reflecting the new value (e.g., 100G).
Step 3: Extend the Existing Partition
Your LVM is using /dev/sda2. You need to extend this partition to use the additional disk space:
Install growpart if not installed:
sudo yum install cloud-utils-growpart -yExtend the second partition:
sudo growpart /dev/sda 2Update the partition table:
sudo partprobeCheck disk size again:
lsblkEnsure that /dev/sda2 has grown to match the total disk size (less boot partition).
Step 4: Extend the LVM and Filesystem
1: Resize the physical volume:
sudo pvresize /dev/sda22: Confirm the physical volume is resized and shows free space:
vgsYou should see VFree showing available space (e.g., 40G).
If VFree is still 0, the partition may not have been extended correctly. You may need to re-run:
sudo growpart /dev/sda 2
sudo pvresize /dev/sda23: Extend the logical volume:
sudo lvextend -r -l +100%FREE /dev/mapper/SangomaVG-rootThe -r flag automatically resizes the filesystem. If the -r option fails or doesn't resize, do this manually:
sudo lvextend -l +100%FREE /dev/mapper/SangomaVG-root
sudo xfs_growfs /4: Confirm New Disk Space
df -hYou should now see the increased space in /.