System and processes

The vgs command

Compact summary of LVM volume groups: disks, volumes and sizes.

Syntax

vgs [opciones] [grupo...]Try it in the terminal →

Most useful options

-aLists all groups. It is the same as not naming any.
-o camposChooses the columns to show, separated by commas. Use -o help to see every available field.
-S criterioFilters rows by a criterion. The syntax is shown by --select help.
--noheadingsRemoves the header line. Useful when processing the output with grep or awk.
--units unidadChanges the size unit: g for gigabytes, m for megabytes or h for human-readable.
-O camposSorts the rows by one or more comma-separated columns.

Copy-ready examples

$ sudo vgsshows a summary of all groups.
$ sudo vgs -o vg_name,vg_size,vg_freeshows only the name, size and free space of each group.
$ sudo vgs --units g --nosuffix -o vg_name,vg_sizegives the sizes in gigabytes without the g letter, ready to process.
$ sudo vgs --noheadings -o vg_namelists only the names, without a header, for use in a script.

You can try them in the browser terminal: it does not touch your computer.

Common errors

MessageCauseFix
Volume group "datos" not foundNo group has that name, so vgs has nothing to show for it.Run sudo vgs without arguments and use the exact name from the list.

Typical mistakes

  • #PV is how many disks (PV) the group has, and #LV how many logical volumes it contains.
  • VFree is the free space of the group, what you can still assign to a new volume or to one that grows.
  • If you need the detail of each group, use vgdisplay. For the summary, vgs is the recommended option.

Differences from similar commands

  • vgdisplay: shows the long detail of each group. vgs gives a compact, configurable table.
  • pvs: summarizes the physical disks (PV) instead of the groups.
  • lvs: summarizes the logical volumes instead of the groups.

FAQ

What does vgs show by default?

One line per group, with the name, the number of disks (#PV) and volumes (#LV), and the total (VSize) and free (VFree) size.

How do I add more columns?

With -o+field. The + sign adds the field to the default columns.

How do I see the list of available fields?

With sudo vgs -o help. To see the list of group fields, use -o vg_all.

More System and processes commands

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course