[SOLVED] VM disk bigger than local-lvm

Inglebard

Renowned Member
May 20, 2016
102
7
83
32
Hi,

I notice on a proxmox a potential issue with disk size.

I have the following :

Code:
root@proxmox:~# lvs
  LV            VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data          pve twi-aotz-- 384.28g             90.19  4.74                           
  root          pve -wi-ao----  30.00g                                                   
  swap          pve -wi-ao----   8.00g                                                   
  vm-100-disk-0 pve Vwi-aotz-- 400.00g data        86.64

It seems 'vm-100-disk-0' is bigger than 'data'.

What can I do to avoid a futur 'disk full' problem.

I suppose :

1- Add bigger disk on proxmox raid and extend proxmox local-lvm, but how ?
2 - Find a solution to shrink vm-100-disk-0 (ex. qemu-img resize --shrink ), but I suppose it will destroy the partition and a part of the data even if I shrink c: before right ? (I am not sure if it's possible to use 'qemu-img resize' for local lvm )
 
Hi,
both of your suggested solutions can work.

Ad 1):
To extend the LVM thin pool you can use
Code:
pvcreate /dev/disk/by-id/<your new disk>
vgextend pve /dev/disk/by-id/<your new disk>
# assigns all available space in the volume group to pve/data
lvextend pve/data -l100%FREE

Ad 2):
Yes, you have to shrink the partitions on the disk. And you need to make sure that the space at the end of the disk is not used by any partition anymore. You'll have to use lvreduce instead of qemu-img. I'd suggest creating and resizing a dummy LV first to get a feel for it. And best to have a working backup ready for the worst case scenario.
 
Hi @Fabian_E,
Thanks for your answer.
Since I use virtio, I enabled the "discard" option to gain some space. I will defrag the VM disk and reduce the guest partition to be sure to never full the virtual disk (and local-lvm partition).
This will allow to wait and prepare for 1) as you described.
 
  • Like
Reactions: fiona

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!