PBX Platforms -How to Increase VMware VM Disk Size

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

  1. Power off the VM (optional but safer).

  2. 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.

  3. Power on the VM.


Step 2: Rescan the Disk

After booting into FreePBX:

sudo echo 1 > /sys/class/block/sda/device/rescan

These commands help the OS detect the new disk size without rebooting.

Verify the new disk size:

lsblk

Look 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:

  1. Install growpart if not installed:

sudo yum install cloud-utils-growpart -y
  1. Extend the second partition:

sudo growpart /dev/sda 2

Update the partition table:

sudo partprobe
  1. Check disk size again:

lsblk

Ensure 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/sda2

2: Confirm the physical volume is resized and shows free space:

vgs

You 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/sda2

3: Extend the logical volume:

sudo lvextend -r -l +100%FREE /dev/mapper/SangomaVG-root

The -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 -h

You should now see the increased space in /.

Unable to render {include} The included page could not be found.