How to Expand Your VM Disk
Grow your VM's disk after an upgrade: extend the partition and filesystem on Linux (LVM and non-LVM) and Windows, then verify the new size.
Updated 2026-08-20
-
Expanding a VM's disk is a two-part job. First we grow the underlying virtual disk on the host — that part happens on our side when you upgrade or request more storage. After that the disk is bigger, but your operating system does not use the new space yet: the partition and the filesystem inside the VM still stop at the old boundary.
The steps below are the second part — the ones you run inside the VM to grow the partition and filesystem into the space we already added. Pick the section that matches your operating system.
Take a backup or snapshot before you start. Resizing a live filesystem is routine, but a snapshot means a mistake costs minutes, not data.
-
Recent Ubuntu and Debian installs use LVM by default, where the root filesystem sits on a logical volume such as
/dev/mapper/ubuntu--vg-ubuntu--lv. Confirm your layout first:lsblkYou should see the disk (
/dev/sda), a partition (/dev/sda3) that is now smaller than the disk, and the LVM volume on top of it. Grow the partition, then the physical volume, then the logical volume, then the filesystem:growpart /dev/sda 3 pvresize /dev/sda3 lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv resize2fs /dev/mapper/ubuntu--vg-ubuntu--lvEach command works up one layer:
growpartenlarges the partition,pvresizetells LVM the physical volume is bigger,lvextend -l +100%FREEhands all the new space to the logical volume, andresize2fsgrows the ext4 filesystem to fill it. If your root filesystem is XFS, usexfs_growfs /instead ofresize2fs. -
If
lsblkshows your root filesystem sitting directly on a partition (for example/dev/sda1) with no LVM layer in between, there are only two steps — grow the partition, then grow the filesystem:growpart /dev/sda 1 resize2fs /dev/sda1For an XFS filesystem, grow it by mount point rather than device:
growpart /dev/sda 1 xfs_growfs /resize2fshandles ext2/ext3/ext4;xfs_growfshandles XFS and takes the mount point. Both can run while the filesystem is mounted and in use. -
On Windows the new space appears as unallocated space on the existing disk. The graphical way is fastest: open Disk Management (right-click Start → Disk Management, or run
diskmgmt.msc), right-click the C: volume, and choose Extend Volume. The wizard adds the adjacent unallocated space automatically.If the new space is not shown yet, choose Action → Rescan Disks first. To do the same from a command prompt with
diskpart:diskpart rescan list volume select volume C extendrescanmakes Windows notice the larger disk,select volume Cpicks the volume to grow, andextendwith no size argument uses all the contiguous free space. -
Confirm the operating system now sees the full disk. On Linux:
df -hThe root filesystem should report the new total size. On Windows, the C: drive in File Explorer or Disk Management should show the larger capacity.
If the number still looks small, re-run
lsblk(Linux) or Rescan Disks (Windows) and check you resized the right partition. Still stuck? Open a ticket and we will take a look.