Installation guide

Chapter 4. LVM Administration with CLI Commands
50
/dev/sdb1 17.14G
/dev/sdc1 17.14G
/dev/sdd1 17.14G
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.
# pvs -o +pv_uuid
PV VG Fmt Attr PSize PFree PV UUID
/dev/sdb1 new_vg lvm2 a- 17.14G 17.14G onFF2w-1fLC-ughJ-D9eB-M7iv-6XqA-dqGeXY
/dev/sdc1 new_vg lvm2 a- 17.14G 17.09G Joqlch-yWSj-kuEn-IdwM-01S9-X08M-mcpsVe
/dev/sdd1 new_vg lvm2 a- 17.14G 17.14G yvfvZK-Cf31-j75k-dECm-0RZ3-0dGW-UqkCS
Adding the -v argument to a command includes some extra fields. For example, the pvs -v
command will display the DevSize and PV UUID fields in addition to the default fields.
# pvs -v
Scanning for physical volume names
PV VG Fmt Attr PSize PFree DevSize PV UUID
/dev/sdb1 new_vg lvm2 a- 17.14G 17.14G 17.14G onFF2w-1fLC-ughJ-D9eB-M7iv-6XqA-dqGeXY
/dev/sdc1 new_vg lvm2 a- 17.14G 17.09G 17.14G Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe
/dev/sdd1 new_vg lvm2 a- 17.14G 17.14G 17.14G yvfvZK-Cf31-j75k-dECm-0RZ3-0dGW-tUqkCS
The --noheadings argument suppresses the headings line. This can be useful for writing scripts.
The following example uses the --noheadings argument in combination with the pv_name
argument, which will generate a list of all physical volumes.
# pvs --noheadings -o pv_name
/dev/sdb1
/dev/sdc1
/dev/sdd1
The --separator separator argument uses separator to separate each field.
The following example separates the default output fields of the pvs command with an equals sign
(=).
# pvs --separator =
PV=VG=Fmt=Attr=PSize=PFree
/dev/sdb1=new_vg=lvm2=a-=17.14G=17.14G
/dev/sdc1=new_vg=lvm2=a-=17.14G=17.09G
/dev/sdd1=new_vg=lvm2=a-=17.14G=17.14G
To keep the fields aligned when using the separator argument, use the separator argument in
conjunction with the --aligned argument.
# pvs --separator = --aligned
PV =VG =Fmt =Attr=PSize =PFree
/dev/sdb1 =new_vg=lvm2=a- =17.14G=17.14G
/dev/sdc1 =new_vg=lvm2=a- =17.14G=17.09G