LXC resizing failed but Task shows OK

karnz

Renowned Member
Nov 23, 2015
60
3
73
Hi,
I want to resize LXC by increasing 50GB.

Here's log.
--------------
For thin pool auto extension activation/thin_pool_autoextend_threshold should be below 100.
Size of logical volume pve/vm-104-disk-1 changed from 250.00 GiB (64000 extents) to 300.00 GiB (76800 extents).
Logical volume pve/vm-104-disk-1 successfully resized.
WARNING: Sum of all thin volume sizes (540.00 GiB) exceeds the size of thin pool pve/data and the size of whole volume group (446.88 GiB)!
resize2fs 1.43.4 (31-Jan-2017)
Filesystem at /dev/pve/vm-104-disk-1 is mounted on /tmp; on-line resizing required
old_desc_blocks = 32, new_desc_blocks = 38
resize2fs: Permission denied to resize filesystem
Failed to update the container's filesystem: command 'unshare -m -- sh -c 'mount --make-rprivate / && mount /dev/pve/vm-104-disk-1 /tmp && resize2fs /dev/pve/vm-104-disk-1'' failed: exit code 1

TASK OK
--------------

After that, GUI shows volume size was changed as wish but 'df -h' command in the LXC says nothing changed.
I ever done this with online LXC and it was completed successfully but this time failed.

Should I have to shutdown the LXC and then resize for another 50GB again? Will it increase for 50+50GB?
 
There are two steps here: The first one resizes the images, this was successful. The second one was to resize the filesystem on top of that image, this failed. You'll want to shutdown the container, run fsck, mount it and then run resize2fs manually:
Code:
# pct fsck 104
# pct mount 104
# resize2fs /var/lib/lxc/104/rootfs
# pct unmount 104