vgs Command Examples in Linux

vgs is a command-line utility that displays information about Logical Volume Manager (LVM) volume groups. LVM is a system that allows users to manage logical volumes, which are virtual storage devices created by combining multiple physical storage devices. Volume groups are collections of physical volumes that have been combined into a single logical volume for easier management.

With vgs, you can obtain a summary of information about all the volume groups on the system, including their size, number of physical volumes, and free space. You can also use vgs to obtain more detailed information about a specific volume group, such as the size and number of its logical volumes, the physical volumes that make up the group, and the status of each volume.

The output of vgs includes the following information:

  • VG Name: The name of the volume group.
  • VG UUID: The universally unique identifier (UUID) of the volume group.
  • PV Count: The number of physical volumes in the volume group.
  • LV Count: The number of logical volumes in the volume group.
  • SN Attr: The status of the volume group. For example, “w” indicates that the volume group is writable, while “r” indicates that it is read-only.
  • V Size: The size of the volume group.
  • V Free: The amount of free space in the volume group.

Some of the common use cases for vgs include:

  • Checking the status of volume groups: You can use vgs to check whether a volume group is active or inactive, and to see how much free space is available in the group.
  • Viewing detailed information about a volume group: You can use vgs to view the size and status of each logical volume in a volume group, as well as the physical volumes that make up the group.
  • Troubleshooting LVM issues: vgs can be used to diagnose LVM issues, such as when a logical volume is full or when a physical volume is failing.

vgs Command Examples

1. Display information about volume groups:

# vgs

2. Display all volume groups:

# vgs -a

3. Change default display to show more details:

# vgs -v

4. Display only specific fields:

# vgs -o field_name_1,field_name_2

5. Append field to default display:

# vgs -o +field_name

6. Suppress heading line:

# vgs --noheadings

7. Use separator to separate fields:

# vgs --separator =

Summary

vgchange is a powerful tool that should be used with caution. Before using it, make sure you have a good understanding of LVM and its concepts. You can find more information on vgchange and other LVM commands in the lvm2 man pages or online documentation.

Related Post