Shrink your LXC disk on proxmox

You may want to reduce the size of your LXC disk on proxmox, but the web interface only allow you to increase the size, not decrease.

To reduce the size, follow these steps:

List your containers

pct list

Stop the container you want to resize

pct stop 100

Run a file system check

e2fsck -fy /var/lib/vz/images/100/vm-100-disk-0.raw

Resize the file system

resize2fs /var/lib/vz/images/100/vm-100-disk-0.raw 50G

Edit the container's configuration file with the new size (50G)

# rootfs: local:100/vm-100-disk-0.raw,size=50G
vi /etc/pve/lxc/100.conf

Start the container

pct start 100

Enter and check the resize container disk

pct enter 100
df -h

Pierre FILSTROFF

Senior Software Engineer - IC - Ruby on Rails/Hotwire - Android/iOS - DevOPS