Proxmox - Resizing a LXC Disk

Nov 12, 2021 -- 1 min read

The Proxmox Web-UI is great but it doesn’t allow for reducing the size of a VM disk or Container disk that you may have overdone. Here’s how to do it.

You will need access to your Proxmox node via SSH or directly.

This applies to the standard Proxmox setup using LVM.

On your Proxmox node, do the following:

List containers

Terminal window
pct list

Stop the container you want to resize

Terminal window
pct stop 420

Find out it’s path on the node

Terminal window
lvdisplay | grep "LV Path\|LV Size"

Run a file system check

Terminal window
e2fsck -fy /dev/pve/vm-420-disk-0

Resize the file system

Terminal window
resize2fs /dev/pve/vm-420-disk-0 10G

Resize the local volume

Terminal window
lvreduce -L 10G /dev/pve/vm-420-disk-0

Edit the container’s conf file

Terminal window
nano /etc/pve/lxc/420.conf

Update the following line accordingly

FROM:
rootfs: local-lvm:vm-420-disk-0,size=20G
TO:
rootfs: local-lvm:vm-420-disk-0,size=10G

Start the container

Terminal window
pct start 420

Enter and check the resize container disk

Terminal window
pct enter 420
df -h

Source: Proxmox Forum [Online] Available: https://forum.proxmox.com/threads/resize-lxc-disk-on-proxmox.68901/