Understanding LVM-thin volume attributes

sysrook

Member
Aug 14, 2017
2
1
8
73
Running Proxmox 5.2 with lvm-thin local storage for my VM raw disks. Looking for clarification on the output of the lvs command and the meaning of the Data% column. The lvs man page doesn't seem to explain data percent anywhere. The confusion arises since several raw disks have a Data% of nearly 100, even though there is plenty of disk space from the perspective of the guests. For example vm-125-disk-0 below is 99.36% but the guest is barely touching its disk space as shown. What does Data% actually represent? Are there any implications to approaching 100% values? Also why are there no values for Meta% for each of the thin volumes/disks? Thanks
Code:
root@prox1:~# lvs -a
  LV              VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  base-100-disk-1 pve Vri---tz-k  12.00g data
  data            pve twi-aotz--   2.05t             45.35  1.40
  [data_tdata]    pve Twi-ao----   2.05t
  [data_tmeta]    pve ewi-ao----   1.07g
  [lvol0_pmspare] pve ewi-------  68.00m
  root            pve -wi-ao----  96.00g
  swap            pve -wi-ao----  24.00g
  vm-102-disk-1   pve Vwi-a-tz--  60.00g data        100.00
  vm-109-disk-1   pve Vwi-aotz--  40.00g data        99.94
  vm-110-disk-0   pve Vwi-aotz-- 100.00g data        93.69
  vm-110-disk-1   pve Vwi-aotz--  30.00g data        99.92
  vm-112-disk-0   pve Vwi-a-tz--  81.00g data        69.46
  vm-113-disk-0   pve Vwi-aotz--  81.00g data        97.16
  vm-121-disk-0   pve Vwi-a-tz--  25.50g data        66.30
  vm-122-disk-0   pve Vwi-aotz--  25.50g data        75.44
  vm-125-disk-0   pve Vwi-aotz--  31.00g data        99.36
Guest disk usage for vm-125-disk-0 :
Code:
root@guest125:~$ df -kh
Filesystem                       Size  Used Avail Use% Mounted on
udev                             2.0G     0  2.0G   0% /dev
tmpfs                            396M   11M  385M   3% /run
/dev/mapper/ubuntu--13--vg-root   28G  6.5G   20G  25% /
tmpfs                            2.0G   16K  2.0G   1% /dev/shm
tmpfs                            5.0M     0  5.0M   0% /run/lock
tmpfs                            2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda1                        721M  106M  579M  16% /boot
cgmfs                            100K     0  100K   0% /run/cgmanager/fs
tmpfs                            396M     0  396M   0% /run/user/1001
tmpfs                            396M     0  396M   0% /run/user/1003
 
  • Like
Reactions: rcd
What does Data% actually represent?
the % of the mapped space in the lv, if your guest writes data and deletes them again, it does not necessarily notify the storage below that this is unused,
so depending on the write pattern this can be higher than the 'actual' data usage

if your disks are configured as scsiX with virtion-scsi, you can activate the 'discard' option on the disks and execute a fstrim inside the guest
this should then notify qemu which should in turn notify lvm which should mark the relevant blocks as free again

Also why are there no values for Meta% for each of the thin volumes/disks?
because the metadata is only relevant per thinpool so only the thinpool has a meta%
 
  • Like
Reactions: rcd and rhonda

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!