How to Resize a Disk in Proxmox LXC Container

The Proxmox Web-UI is great but it doesn’t allow for increasing or reducing the size of a LXC 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

pct list

Stop the container you want to resize

pct stop 201

Find out it’s path on the node

lvdisplay | grep "LV Path\|LV Size"

Run a file system check

e2fsck -fy /dev/pve/vm-201-disk-0

Resize the file system

resize2fs /dev/pve/vm-201-disk-0 13G

Resize the local volume

lvresize -L 13G /dev/pve/vm-401-disk-0

Edit the container’s conf file

nano /etc/pve/lxc/201.conf

Update the following line accordingly

FROM:

rootfs: local-lvm:vm-201-disk-0,size=7G

TO:

rootfs: local-lvm:vm-201-disk-0,size=13G

Start the container

pct start 201

Enter and check the resize container disk

pct enter 201
df -h

Leave a Reply