What it does
vgs prints one line per VG: number of PVs and LVs, size and free space. vgdisplay shows the details, including the PE Size and the number of free extents — needed for lvcreate -l.
How to write it
vgs [OPTION]... [VG...]
vgdisplay [OPTION]... [VG...]
vgscan [OPTION]...Options 28
Most used
Report (vgs)
vgdisplay
Common LVM options
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1All VGs
vgs VG #PV #LV #SN Attr VSize VFree rhel 1 2 0 wz--n- <19.00g 0 vgdata 2 1 0 wz--n- <14.99g <9.99gVFree = space for new or bigger LVs.
2Details with PE size
vgdisplay vgdataPE Size, Total PE, Alloc PE, Free PE / Size.
3Free extents only
vgs -o vg_name,vg_extent_size,vg_free_count vgdataExactly what lvcreate -l needs.
4In MiB
vgs --units m vgdataExact numbers.
5VG with its LVs and PVs
vgdisplay -v vgdataAll in one view.
6VGs that are almost full (monitoring)
vgs -S 'vg_free<1g' -o vg_name,vg_freePlan to add disks.
7Script value
vgs --noheadings --nosuffix --units g -o vg_free vgdataA number for checks.
8JSON
vgs --reportformat jsonFor automation tools.
9Scan after moving disks between servers
vgscan; vgchange -ayFinds and activates the moved VGs.
10Check the VG attributes
vgs -o +vg_attr,vg_systemidw = writable, z = resizable, n = normal allocation.
Nothing matches this filter.
Exit codes
0 :: Done. 5 :: Error.