Shrink disk size vm/lxc

Arty

New Member
Mar 10, 2018
2
0
1
45
Hi,

Increasing work fine from GUI and CLI. But, I would like to know, is it possible to reduce the size of the disk in vm/lxc? And, if it possible, how to do it?
In documentation I can't find about it.

Thanks!
 
Hi,

shrinking has to be done manual.
This is because you have to shrink the guest file system before you can shrink the virtual disk image
 
Is there a way to do this while restoring a backup or cloning a VM ? I'm too interested in shrinking a big VM after moving out several gigabytes of data as it raise backup problems (large backup storing static data).

Patrick (using PVE 4)
 
Hi,

Increasing work fine from GUI and CLI. But, I would like to know, is it possible to reduce the size of the disk in vm/lxc? And, if it possible, how to do it?
In documentation I can't find about it.

Thanks!
If you're using a local ZFS pool with LXC on a filesystem (the default for local ZFS storage) rather than a disk image , you can shrink or grow the filesystem at any time with (adjust 100G to the desired size):
Code:
zfs set refquota=100G POOL/FILESYSTEM

Disk images or block devices can only be managed as Wolfgang indicated.