The pvs
command is a Linux command that is used to display information about physical volumes (PVs) on the system. The command displays information such as the name of the physical volume, the size of the physical volume, the amount of free space on the physical volume, and the number of physical extents on the physical volume. This information is useful for managing the storage on a Linux system.
Overview
The pvs
command is used to display information about physical volumes on the system. The command takes no arguments and displays information about all physical volumes on the system.
Here’s an example output of the pvs
command:
PV VG Fmt Attr PSize PFree
/dev/sda2 vg01 lvm2 a-- 100.00g 0
/dev/sdb1 vg02 lvm2 a-- 200.00g 50.00g
In the example output, we can see that there are two physical volumes on the system. The first physical volume is /dev/sda2
and is a member of the vg01
volume group. The second physical volume is /dev/sdb1
and is a member of the vg02
volume group. We can also see that the first physical volume has no free space, while the second physical volume has 50GB of free space.
Options
The pvs
command has several options that can be used to modify its behavior. Here is a table of the available options:
Option | Description |
---|---|
-a |
Display all physical volumes, including those that are not members of a volume group. |
-o |
Specify the output format. This option takes a comma-separated list of columns to display. |
-O |
Specify the output format. This option takes a format string that is passed to the printf function. |
-S |
Sort the output by a specified column. |
Troubleshooting tips
The pvs
command is generally very reliable and should not cause any issues. However, if you are having trouble getting the output you expect, here are some troubleshooting tips:
- Make sure you are running the command as root or with sudo privileges.
- Double-check the options you are using to make sure they are correct.
- If you are not seeing the output you expect, try using the
-a
option to display all physical volumes, including those that are not members of a volume group.
Notes
- The
pvs
command is part of the LVM (Logical Volume Manager) suite of tools and requires LVM to be installed on the system. - The
pvs
command is similar to thepvdisplay
command, but provides a more concise output format.