[PVE-User] Thin LVM showing more used space than expected

Óscar de Arriba oscar at dearriba.es
Mon Jan 2 10:56:27 CET 2023


I ended up reinstalling th server and using ZFS this time. It solved all the issues - the ghost used space is back and I could restore even a VM 3x times bigger without any slowdown. 

Not sure what happened but with all that space occupied my best guess is that during the restoration of VMs LVM was getting out of blocks to use and needed to do some cleanups, which led to that slow performance at ~5Mbps. However, it is strange that I could not find anyone else facing this issue.

On Thu, Dec 29, 2022, at 17:58, Óscar de Arriba wrote:
> Update: I have enabled `Discard` option in all disks of the VMs on that server and then `fstim` did the work and freed some space.
> 
> However, even removing all VMs except one (which is hard to remove without disruption) I can see that:
> 
> root at venom:~# lvs
>   LV            VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
>   data          pve twi-aotz-- 377.55g             60.65  0.67                            
>   root          pve -wi-ao----  60.00g                                                    
>   swap          pve -wi-ao----   4.00g                                                    
>   vm-201-disk-0 pve Vwi-aotz--   4.00m data        14.06                                  
>   vm-201-disk-1 pve Vwi-aotz--  40.00g data        56.58
> 
> Which means that I have about 200 GB used out of nowhere :( At least it is no longer under pressure of being almost 100% full.
> 
> On Thu, Dec 29, 2022, at 11:48, Óscar de Arriba wrote:
>> Any idea why it still has 96.23% of space used but the VMs are using way less? I'm starting to worry a lot about it (I don't kant tobe really full) and my current only hope is backup + reinstall PVE.
>> 
>> Thanks,
>> Oscar
>> 
>> On Thu, Dec 29, 2022, at 11:01, Martin Holub wrote:
>>> 
>>> 
>>> Am 28.12.2022 um 12:44 schrieb Óscar de Arriba:
>>>> Hi Martin,
>>>> 
>>>> > Did you try to run a fstrim on the VMs to regain the allocated space? At least on linux something like "fstrim -av" should do the trick.
>>>> 
>>>> I did it now and it freed ~55GiB of a running isntance (the one with 128 GiB allocated). However that should only free blocks of the LV used to store that VM disk, right? And the issue itself is that the sum of maximum allocations of those disks is much lower than the space occupied.
>>>> 
>>>> I also have the feeling that those blocks remain used by a no longer existant LVs, but I don't know how to fix it.
>>>> 
>>>> Should I also enable trim/execute trim on Proxmox itself?
>>>> 
>>>> Oscar
>>>> 
>>> 
>>> 
>>> 
>>> 
>>> Hi,
>>> 
>>> TRIM only works on a filesystem level, so you can't trim a VG or similar. On the pve host i doubt it will help, but it wouldn't harm either. 
>>> 
>>> hth
>>> Martin
>>> 
>>> 
>> 
> 


More information about the pve-user mailing list