Skip to main content

How to resizea Linux (Ubuntu) disk in Proxmox

In proxmox, ensure the VM is off and then select the VM you wish to resize the disk. Click on Hardware, locate and select the disk and then on top click on Disk Action --> Resize. In the Resize disk window enter the size in GB you wish to increase by and click on Resize disk. Next, power on the machine, login to the CLI as root and run the following commands:

# 1. Identify the disk device
fdisk -l
Disk /dev/sda: 650 GiB, 697932185600 bytes, 1363148800 sectors
Disk model: QEMU HARDDISK   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 218F2D76-B023-4E53-A9A3-1C99785FF2AF

Device     Start        End    Sectors  Size Type
/dev/sda1   2048       4095       2048    1M BIOS boot
/dev/sda2   4096 1363148766 1363144671  650G Linux filesystem

# 2. Grow the partition to fill the disk  (note the SPACE: "sda 2", not "sda2")
sudo growpart /dev/sda 2

# 3. Grow the ext4 filesystem to fill the partition
sudo resize2fs /dev/sda2

# 4. verify
df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  2.7M  1.6G   1% /run
/dev/sda2       639G  129G  482G  22% /
tmpfs           7.9G     0  7.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock