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

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

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

    lsblk

    You 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--lv

    Each command works up one layer: growpart enlarges the partition, pvresize tells LVM the physical volume is bigger, lvextend -l +100%FREE hands all the new space to the logical volume, and resize2fs grows the ext4 filesystem to fill it. If your root filesystem is XFS, use xfs_growfs / instead of resize2fs.

  3. If lsblk shows 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/sda1

    For an XFS filesystem, grow it by mount point rather than device:

    growpart /dev/sda 1
    xfs_growfs /

    resize2fs handles ext2/ext3/ext4; xfs_growfs handles XFS and takes the mount point. Both can run while the filesystem is mounted and in use.

  4. 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
    extend

    rescan makes Windows notice the larger disk, select volume C picks the volume to grow, and extend with no size argument uses all the contiguous free space.

  5. Confirm the operating system now sees the full disk. On Linux:

    df -h

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

See plans Ask a question