how to get the really usage disk space of a lvm or ct

huky

Renowned Member
Jul 1, 2016
70
3
73
44
Chongqing, China
the shared storage is vg1 from a fc san.

for example, I allocate 200G for a ct

PVE GUI summary show:
Bootdisk size 16.00% (157.34 GiB of 983.30GiB)

df inseide ct
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg1-vm--342--disk--0 984G 158G 776G 17% /
......


PVE node lvdispaly show
# lvdisplay vg_ccs/vm-342-disk-0
--- Logical volume ---
LV Path /dev/vg1/vm-342-disk-0
LV Name vm-342-disk-0
VG Name vg1
...
LV Status available
# open 1
LV Size 1000.00 GiB
......


so, the really allocated usage space on the vg1 is 1000G, 158G?
 
hi,

yes only 158G is allocated because of thin provisioning.

you can also check the output of lvs -a to see an overview
 
thanks
hi,

yes only 158G is allocated because of thin provisioning.

you can also check the output of lvs -a to see an overview
but how PVE find the really size
Bootdisk size 16.00% (157.34 GiB of 983.30GiB)

I could not find used map:
# lvdisplay -a vg1/vm-342-disk-0
--- Logical volume ---
LV Path /dev/vg1/vm-342-disk-0
LV Name vm-342-disk-0
VG Name vg1
LV UUID jRFq82-Kac4-7pPQ-1fOZ-sFn7-lCsd-ULgdnz
LV Write Access read/write
LV Creation host, time ynode003, 2021-01-15 18:27:14 +0800
LV Status NOT available
LV Size 1000.00 GiB
Current LE 256000
Segments 2
Allocation inherit
Read ahead sectors auto

vdisplay -a vg1/vm-204-disk-2
--- Logical volume ---
LV Path /dev/vg1/vm-204-disk-2
LV Name vm-204-disk-2
VG Name vg1
LV UUID rO09Gh-dtpz-6GIk-DymC-Re7l-5rj9-C3M2Mj
LV Write Access read/write
LV Creation host, time ynode006, 2017-03-31 09:31:19 +0800
LV Status available
# open 0
LV Size 600.00 GiB
Current LE 153600
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:93
 
but how PVE find the really size
it's calculated from the used percentage and the total size.

you can calculate it too:

used_absolute = (used_percent * lv_size) / 100

so in your case:

used_absolute = ( 16 * 983G ) / 100 = 157G
 

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!