4.2.2. Displaying Physical Volumes
There are three commands you can use to display properties of LVM physical volumes:
pvscommand provides physical volume information in a configurable form, displaying one line per physical volume. The
pvscommand provides a great deal of format control, and is useful for scripting. For information on using the
pvscommand to customize your output, see Section 4.9, “Customized Reporting for LVM”.
pvdisplaycommand provides a verbose multi-line output for each physical volume. It displays physical properties (size, extents, volume group, etc.) in a fixed format.
The following example shows the output of the
pvdisplaycommand for a single physical volume.
pvdisplay--- Physical volume --- PV Name /dev/sdc1 VG Name new_vg PV Size 17.14 GB / not usable 3.40 MB Allocatable yes PE Size (KByte) 4096 Total PE 4388 Free PE 4375 Allocated PE 13 PV UUID Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe
pvscancommand scans all supported LVM block devices in the system for physical volumes.
The following command shows all physical devices found:
pvscanPV /dev/sdb2 VG vg0 lvm2 [964.00 MB / 0 free] PV /dev/sdc1 VG vg0 lvm2 [964.00 MB / 428.00 MB free] PV /dev/sdc2 lvm2 [964.84 MB] Total: 3 [2.83 GB] / in use: 2 [1.88 GB] / in no VG: 1 [964.84 MB]
You can define a filter in the
lvm.confso that this command will avoid scanning specific physical volumes. For information on using filters to control which devices are scanned, see Section 4.6, “Controlling LVM Device Scans with Filters”.