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.
If you encounter the below error while running the command vgs:
vgs: command not found
you may try installing the below package as per your choice of distribution:
|Debian||apt-get install lvm2|
|Ubuntu||apt-get install lvm2|
|Alpine||apk add lvm2|
|Arch Linux||pacman -S lvm2|
|Kali Linux||apt-get install lvm2|
|CentOS||yum install lvm2|
|Fedora||dnf install lvm2|
|Raspbian||apt-get install lvm2|
vgs Command Examples
1. Display information about volume groups:
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 =
vgs is a powerful tool that can be used to manage and troubleshoot LVM volume groups. It is part of the lvm2 package, which is available on most Linux distributions. You can find more information on vgs and other LVM commands in the lvm2 man pages or online documentation.