How to Resize a Linux Container in Proxmox

How to resize a Linux container in Proxmox: use pct resize, not the old lvextend crap that can corrupt your storage. It’s dead simple once you know the right command, and it works for rootfs and any mounted volumes.

Just use pct resize
Forget the forum posts telling you to run lvextend directly on the backing storage. That advice is ancient and dangerous — you’re bypassing Proxmox’s own management layer, and if you mess up the logical volume, the container’s toast. The modern way is pct resize, and it handles everything cleanly.
Here’s the basic syntax:
pct resize <vmid> <disk> <size>For example, to bump the root filesystem of container 101 to 20 gigabytes:
pct resize 101 rootfs 20GThat’s it. No messing with LVM, no manual resizing of the filesystem inside the container — pct resize does it all. If your container is running, it’ll even resize online without a reboot most of the time. Damn handy.
Real output so you know what to expect
When you run it, you’ll see something like this:
root@pve:~# pct resize 101 rootfs 20G
Size of logical volume pve/vm-101-disk-0 changed from 10.00 GiB (2560 extents) to 20.00 GiB (5120 extents).
Logical volume pve/vm-101-disk-0 successfully resized.
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/pve/vm-101-disk-0 is mounted on /var/lib/lxc/101/rootfs; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/pve/vm-101-disk-0 is now 5242880 (4k) blocks long.
Notice it automatically calls resize2fs for you. That’s the part people screw up when they do it manually. Proxmox takes care of it.

Resizing mounted volumes
If you’ve added extra mount points to your container (like for Plex media or whatever), you resize those the same way. Just reference the mount point name from your container config. Say you have a mount point called mp0 at /mnt/media:
pct resize 101 mp0 +10GThe +10G adds 10 gigs to whatever it already has. You can also set an absolute size like 50G. Check your current config with pct config 101 to see the names.
Why the old lvextend advice is junk
Back before pct resize existed, you had to do it the hard way: find the logical volume, extend it with lvextend, then run resize2fs inside the container. The problem is, if you get the LV path wrong or forget to resize the filesystem, you end up with a container that thinks it has space but actually doesn’t, or worse, a corrupted filesystem. Proxmox’s storage layer might be LVM, ZFS, or Ceph — pct resize abstracts all that crap away. You don’t need to know what’s underneath.
I’d only touch lvextend if I were debugging something really broken, and even then, I’d rather just restore from backup. Keep it simple.
If it doesn’t work
Sometimes you’ll hit a “disk is already in use” error if the container is locked. Shut it down first: pct shutdown 101, wait a sec, then resize. If it’s stubborn, pct unlock 101 might help, but that’s a last resort. Also, make sure you have enough free space in your storage pool — obvious, but easy to overlook.
For more Proxmox container fixes, check out Fix 'Must be connected to a terminal' when attaching screen inside a Proxmox LXC container — same kind of annoying error that should just work.