Displaying Physical Volumes
There are three commands you can use to display properties of LVM physical volumes: pvs,pvdisplay, and pvscan.
The pvs command provides physical volume information in a configurable form, displaying one line per physical volume. The pvs command provides a great deal of format control, and is useful for scripting.
The pvdisplay command 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 pvdisplay command for a single physical volume.
Displaying Volume Groups
There are two commands you can use to display properties of LVM volume groups: vgs and vgdisplay.
The vgscan command, which scans all the disks for volume groups and rebuilds the LVM cache file, also displays the volume groups.
The vgs command provides volume group information in a configurable form, displaying one line per volume group. The vgs command provides a great deal of format control, and is useful for scripting.
The vgdisplay command displays volume group properties (such as size, extents, number of physical volumes, etc.) in a fixed form. The following example shows the output of a vgdisplay command for the volume group new_vg. If you do not specify a volume group, all existing volume groups are displayed.
# vgdisplay new_vg
— Volume group —
VG Name new_vg
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 11
VG Access read/write
VG Status resizable
DESCRIPTION
vgdisplay allows you to see the attributes of VolumeGroupName (or all volume groups if none is given) with it’s physical and logical volumes and their sizes etc.
vgs (8) is an alternative that provides the same information in the style of ps (1).
Displaying Physical Volumes
There are three commands you can use to display properties of LVM physical volumes: pvs, pvdisplay, and pvscan.
The pvs command provides physical volume information in a configurable form, displaying one line per physical volume.
The pvs command provides a great deal of format control, and is useful for scripting.
For information on using the pvs command to customize your output,
The pvdisplay command 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 pvdisplay command for a single physical volume.
# pvdisplay
— Physical volume —
PV Name /dev/sdc1
The pvscan command scans all supported LVM block devices in the system for physical volumes.
The following command shows all physical devices found:
# pvscan
PV /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]