Skip to content

Reduce vdisk LV size

To reduce the size of a virtual disk containing lvm partitioning do the following:

shutdown the vm and add gparted iso to dvd drive

boot into gparted and open terminal

run lvdisplay to see the root lv name and path

sudo lvdisplay

resize the root lv

sudo lvreduce --resizefs -L {size}G /dev/vg_blah/lv_blah

run pvdisplay to see the volume name/number

sudo pvdisplay

resize the pv

sudo pvresize --setphysicalvolumesize {size}G /dev/sdaX

In gparted GUI reduce the partition size as required

shutdown the guest and in the host resize the physical disk

(careful not to chop off the end of the last partition THINK!!!) lvresize --size {size}G /dev/pve/vm-10X-disk-X

boot back into gparted

(ignore the warning, then fix partition table from terminal) sudo gparted /dev/sdaX x (for expert mode)

e (to relocate the backup partition table to end of disk)

w (to write changes to disk exit)

in terminal resize the pv

(think this might be done by gparted already) pvresize /dev/sdaX

resize the lv to use all available space

lvresize -l +100%FREE /dev/vg_blah/lv_blah