What it does
pvs prints one line per PV with its VG, size and free space. pvdisplay shows all details (PE size, total and free PEs, UUID). With -o you choose report columns and with -S you filter. pvscan scans devices for PVs and can trigger auto-activation.
How to write it
pvs [OPTION]... [PV...]
pvdisplay [OPTION]... [PV...]
pvscan [OPTION]...Options 34
Most used
Report (pvs, also lvs/vgs)
pvdisplay
pvscan
Common LVM options
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1All PVs
pvs PV VG Fmt Attr PSize PFree /dev/vda2 rhel lvm2 a-- <19.00g 0 /dev/vdb1 vgdata lvm2 a-- <5.00g 1.00gPFree = free space on that PV.
2Details of one PV
pvdisplay /dev/vdb1PE Size, Total PE, Free PE, Allocated PE, UUID.
3Which LVs use this PV?
pvdisplay -m /dev/vdb1Needed before you remove a disk.
4Own columns
pvs -o pv_name,vg_name,pv_size,pv_free,dev_sizedev_size shows the size of the device itself.
5PVs with free space
pvs -S 'pv_free>0'Where can new LVs go?
6Sizes in MiB for scripts
pvs --units m --nosuffix --noheadings -o pv_free /dev/vdb1Just a number.
7JSON
pvs --reportformat jsonFor automation.
8PVs not in any VG
pvscan -nNew disks ready to use.
9Scan after adding disks
pvscan --cacheUpdates LVM's view of devices.
10Segments of a PV
pvs --segments -o +lv_nameWhich LV uses which extents.
Nothing matches this filter.
Exit codes
0 | Done. |
5 | Error. |