Get the VM
Select your desired VM stack from the NetFoundry Downloads page:
- VMware: VMDK disk, VMware specific ovf file. open-vm-tools is installed.
- Virtualbox: VMDK disk, VirtualBox specific ovf file.
- KVM: QCOW2 disk with README file
- Hyper-V: Gen1 VHD disk with README file
Register the VM
If your VM stack provides a way to run a script on first boot you may use something like this, substituting your own registration key:
After the hypervisor expands the disk to 100 GB, the OS will see the larger disk but existing partitions and LVM volumes will remain unchanged until manually resized.
2. Verify the Disk Has Been Expanded
Confirm the system detects the new disk size - Expected result:
lsblk sda 100G
If the size has not updated, reboot the system or rescan the disk (see below).
Rescan the Disk (Without Rebooting)
echo 1 | sudo tee /sys/class/block/sda/device/rescan
Verify the new disk size
lsblk
3. Expand the LVM Partition (/dev/sda4)
The main LVM volume group (ubuntu-vg) resides on /dev/sda4. Expand this partition to fill the available space.
# Expand the partition, but do NOT consume 100% of the disk sudo growpart /dev/sda 4
Verify the new size and it should now reflect the increased capacity.
lsblk /dev/sda4
4. Resize the LVM Physical Volume
sudo pvresize /dev/sda4
5. Extend Logical Volumes Using
lvextend -r
This procedure grows /dev/sda4 to consume the remaining disk space and allocates it as follows:
- / → +10 GB
- /var → +10 GB
- /var/log → +30 GB
- /var/tmp → +10 GB
Extend Root Filesystem (/)
sudo lvextend -L +10G -r /dev/ubuntu-vg/ubuntu-lv0
Extend /var
sudo lvextend -L +10G -r /dev/ubuntu-vg/ubuntu-lv1
Extend /var/log
sudo lvextend -L +30G -r /dev/ubuntu-vg/ubuntu-lv2
Extend /var/tmp
sudo lvextend -L +10G -r /dev/ubuntu-vg/ubuntu-lv3
7. Final Verification
Confirm all filesystems reflect the new sizes:
df -h lsblk sudo vgs
8. Notes & Best Practices
- Always expand disks at the hypervisor or cloud layer first
- lvextend -r simplifies resizing by handling the filesystem automatically
- Leave unallocated space in volume groups when possible
- /var and /var/log tend to grow over time
- Take snapshots or backups before resizing production systems
The system is now fully utilizing the expanded disk capacity.
Firewall Requirements