Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
4.9. Customized Reporting for LVM
You can produce concise and customizable reports of LVM objects with the
pvs, lvs, and vgs commands. The reports that these commands generate include one line of output for each object. Each line contains an ordered list of fields of properties related to the object. There are five ways to select the objects to be reported: by physical volume, volume group, logical volume, physical volume segment, and logical volume segment.
The following sections provide:
- A summary of command arguments you can use to control the format of the generated report.
- A list of the fields you can select for each LVM object.
- A summary of command arguments you can use to sort the generated report.
- Instructions for specifying the units of the report output.
4.9.1. Format Control Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Whether you use the
pvs, lvs, or vgs command determines the default set of fields displayed and the sort order. You can control the output of these commands with the following arguments:
- You can change what fields are displayed to something other than the default by using the
-oargument. For example, the following output is the default display for thepvscommand (which displays information about physcial volumes).Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following command displays only the physical volume name and size.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - You can append a field to the output with the plus sign (+), which is used in combination with the -o argument.The following example displays the UUID of the physical volume in addition to the default fields.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Adding the
-vargument to a command includes some extra fields. For example, thepvs -vcommand will display theDevSizeandPV UUIDfields in addition to the default fields.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The
--noheadingsargument suppresses the headings line. This can be useful for writing scripts.The following example uses the--noheadingsargument in combination with thepv_nameargument, which will generate a list of all physical volumes.pvs --noheadings -o pv_name
# pvs --noheadings -o pv_name /dev/sdb1 /dev/sdc1 /dev/sdd1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The
--separator separatorargument uses separator to separate each field.The following example separates the default output fields of thepvscommand with an equals sign (=).Copy to Clipboard Copied! Toggle word wrap Toggle overflow To keep the fields aligned when using theseparatorargument, use theseparatorargument in conjunction with the--alignedargument.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can use the
-P argument of the lvs or vgs command to display information about a failed volume that would otherwise not appear in the output. For information on the output this argument yields, see Section 6.2, “Displaying Information on Failed Devices”.
For a full listing of display arguments, see the
pvs(8), vgs(8) and lvs(8) man pages.
Volume group fields can be mixed with either physical volume (and physical volume segment) fields or with logical volume (and logical volume segment) fields, but physical volume and logical volume fields cannot be mixed. For example, the following command will display one line of output for each physical volume.