Expanding VM Disk Space After Proxmox Resize

The Problem

You expanded a virtual disk in Proxmox, but the guest VM still shows the old disk size and may be running out of space. The VM can’t see or use the additional disk space until you expand the partitions and filesystems inside the guest OS.

Symptoms

  • df -h shows full or nearly full root filesystem
  • Proxmox shows larger disk size than what guest OS reports
  • System may be unstable due to full disk

Solution Steps

1. Check Current Disk Layout

lsblk
df -h

This shows you the current partition structure and filesystem usage. Example:

df -h
Filesystem                         Size  Used Avail Use% Mounted on
tmpfs                              3.1G  1.5M  3.1G   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   15G   14G     0 100% /
tmpfs                               16G     0   16G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
/dev/sda2                          2.0G  192M  1.6G  11% /boot
tmpfs                              3.1G   16K  3.1G   1% /run/user/1000

2. Expand the Partition

sudo growpart /dev/sda 3

Replace 3 with your actual partition number (usually the last one containing your LVM).

3. Expand the Physical Volume

sudo pvresize /dev/sda3

This tells LVM about the additional space in the partition.

4. Check Available Space

sudo vgs

Shows how much free space is now available in your volume group.

5. Expand the Logical Volume

# Use all available space:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

# Or specify amount:
sudo lvextend -L +20G /dev/ubuntu-vg/ubuntu-lv

Replace ubuntu-vg/ubuntu-lv with your actual volume group and logical volume names.

6. Resize the Filesystem

sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

This expands the actual filesystem to use the new space.

7. Verify Success

df -h
lsblk

Your root filesystem should now show much more available space.

Key Points

  • Order matters: Always expand partition → physical volume → logical volume → filesystem
  • No downtime required: All operations can be done while the system is running
  • LVM required: This tutorial assumes your system uses LVM (Logical Volume Manager)
  • Backup first: Consider taking a snapshot before making changes

Common Issues

  • Wrong partition number: Check lsblk output carefully to identify the correct partition
  • Non-LVM systems: If not using LVM, you’ll only need growpart and resize2fs
  • Multiple partitions: You may need to expand an extended partition first

Alternative for Non-LVM Systems

# Expand partition
sudo growpart /dev/sda 1

# Resize filesystem directly
sudo resize2fs /dev/sda1

This process safely expands your VM’s disk space to match what was allocated in Proxmox, resolving disk space issues without data loss.