Learn the Linux Command vgdisplay

USA, New Jersey, Side view of business woman working on desktop pc in office
Tetra Images/Getty Images

The vgdisplay command, common in Linux systems, displays various attributes about volume groups. A volume group is merely a collection of logical volumes that are linked in some logical way. For example, a person with several internal and external hard disks might use separate volume groups for each set of drives, given that Linux expects its volumes to remain persistent (e.g., not disappearing when you unplug the drive).

Terminology

A partition is a physical part a storage medium like a hard disk or a flash drive. A volume, by contrast, can span physical media. For example, a person with one hard disk that has five partitions might see between one and five volumes, depending on how the volumes are defined relative to the partitions.

Although it's more common in larger corporate settings than in most home setups, the use of several logical volumes and volume groups is part of a systems administrative technique called logical volume management—usually just called LVM.

Synopsis

vgdisplay [-A|--activevolumegroups] [-c|--colon] [-d|--debug] [-D|--disk] [-h|--help] [-s|--short] [-v[v]|--verbose [--verbose]] [--version] [VolumeGroupName...]  

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. 

Options

-A--activevolumegroups

Only select the active volume groups.

-c--colon

Generate colon-separated output for easier parsing in scripts or programs.

The values are:
1 volume group name
2 volume group access
3 volume group status
4 internal volume group number
5 maximum number of logical volumes
6 current number of logical volumes
7 open count of all logical volumes in this volume group
8 maximum logical volume size
9 maximum number of physical volumes
10 current number of physical volumes
11 actual number of physical volumes
12 size of volume group in kilobytes
13 physical extent size
14 total number of physical extents for this volume group
15 allocated number of physical extents for this volume group
16 free number of physical extents for this volume group
17 uuid of volume group

-d--debug

Enables additional debugging output (if compiled with DEBUG).

-D--disk

Show attributes from the volume group descriptor area on disk(s). Without this switch, they are shown from the kernel. Useful if the volume group isn't activated.

-h--help

Print a usage message on standard output and exit successfully.

-s--short

Give a short listing showing the existence of volume groups.

-v--verbose

Display verbose information containing long listings of physical and logical volumes. If given twice, also display verbose runtime information of vgdisplay's activities.

--version

Display version and exit successfully.

Cognate Commands

The vgdisplay command doesn't appear on its own; it's part of a suite of commands related to virtual volumes. Other commonly used, and related, commands include:

  • vgcreate—create a volume group
  • vgremove—remove a volume group
  • vgrename—rename a volume group
  • vgscan—scan the filesystem for volume groups
  • lvcreate—create a logical volume
  • lvremove—remove a logical volume
  • lvrename—rename a logical volume
  • lvcan—scan the filesystem for logical volumes
  • lvdisplay—show the attributes of an individual logical volume