
Sorting LVM Reports
47
LV VG Attr LSize Origin Snap% Move Log Copy%
lvol0 new_vg -wi-a- 52.00M
#
lvs --segments
LV VG Attr #Str Type SSize
lvol0 new_vg -wi-a- 1 linear 52.00M
4.9.3. Sorting LVM Reports
Normally the entire output of the
lvs
,
vgs
, or
pvs
command has to be generated and stored internally
before it can be sorted and columns aligned correctly. You can specify the
--unbuffered
argument
to display unsorted output as soon as it is generated.
To specify an alternative ordered list of columns to sort on, use the
-O
argument of any of the reporting
commands. It is not necessary to include these fields within the output itself.
The following example shows the output of the
pvs
command that displays the physical volume name,
size, and free space.
#
pvs -o pv_name,pv_size,pv_free
PV PSize PFree
/dev/sdb1 17.14G 17.14G
/dev/sdc1 17.14G 17.09G
/dev/sdd1 17.14G 17.14G
The following example shows the same output, sorted by the free space field.
#
pvs -o pv_name,pv_size,pv_free -O pv_free
PV PSize PFree
/dev/sdc1 17.14G 17.09G
/dev/sdd1 17.14G 17.14G
/dev/sdb1 17.14G 17.14G
The following example shows that you do not need to display the field on which you are sorting.
#
pvs -o pv_name,pv_size -O pv_free
PV PSize
/dev/sdc1 17.14G
/dev/sdd1 17.14G
/dev/sdb1 17.14G
To display a reverse sort, precede a field you specify after the
-O
argument with the
-
character.
#
pvs -o pv_name,pv_size,pv_free -O -pv_free
PV PSize PFree
/dev/sdd1 17.14G 17.14G
/dev/sdb1 17.14G 17.14G
Summary of Contents for CLUSTER SUITE 4.7 - CLUSTER LVM ADMINISTRATORS
Page 1: ...Red Hat Cluster Suite 4 7 Cluster Logical Volume Manager LVM Administrator s Guide ...
Page 6: ...vi ...
Page 12: ...xii ...
Page 24: ...12 ...
Page 62: ...50 ...
Page 72: ...60 ...
Page 82: ...70 ...
Page 84: ...72 ...
Page 86: ...74 ...
Page 96: ...84 ...
Page 103: ...91 Appendix E Revision History Revision History Revision 1 0 ...
Page 104: ...92 ...
Page 108: ...96 ...