You can increase a VMware Ubuntu Server disk size without rebooting the guest OS, but there are important caveats:
- You can expand the virtual disk (.vmdk) while the VM is running (if VMware supports hot-extend).
- But to make Ubuntu recognize and use the new space, you’ll need to rescan the disk and resize partitions/filesystems manually — all without rebooting.
Here’s the complete guide 👇
-
Open VMware vSphere / Workstation / Fusion.
-
Select your Ubuntu VM → Settings → Hard Disk.
-
Increase the size (e.g., from 20 GB → 40 GB).
- In vSphere, this can be done live (hot-extend) if the VM hardware supports it.
- In Workstation, you might need to power off; check your VMware version.
SSH or open console to Ubuntu, then run:
sudo apt install -y parted
sudo parted -l
Find your main disk (example: /dev/sda
).
Now rescan the disk:
echo 1 | sudo tee /sys/class/block/sda/device/rescan
Or more universally (using rescan-scsi-bus
):
sudo apt install -y scsitools
sudo rescan-scsi-bus
Check the new size recognized:
lsblk
You should now see the updated disk size (but the partition may still be smaller).
If your root partition is on /dev/sda3
, for example:
sudo growpart /dev/sda 3
Then verify:
lsblk
For ext4:
sudo resize2fs /dev/sda3
For xfs:
sudo xfs_growfs /
df -h
You should now see the extra space added to /
.
If you use LVM (common in Ubuntu Server), do this instead of growpart
:
sudo pvresize /dev/sda3
sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
The -r
option automatically resizes the filesystem too.
Task | Command | |
---|---|---|
Rescan disk | `echo 1 | sudo tee /sys/class/block/sda/device/rescan` |
Grow partition | sudo growpart /dev/sda 3 |
|
Resize ext4 | sudo resize2fs /dev/sda3 |
|
Resize xfs | sudo xfs_growfs / |
|
Resize LVM | sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv |