Sorting Lvm Reports - Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR Manual

Cluster logical volume manager
Table of Contents

Advertisement

Using the -v argument with the lvs --segments command adds the following fields to the default
display: seg_start, stripesize, chunksize.
# lvs -v --segments
Finding all logical volumes
LV
VG
lvol0
new_vg owi-a-
newvgsnap1 new_vg swi-a-
The following example shows the default output of the lvs command on a system with one logical
volume configured, followed by the default output of the lvs command with the segments argument
specified.
# lvs
LV
VG
Attr
lvol0 new_vg -wi-a- 52.00M
# lvs --segments
LV
VG
Attr
lvol0 new_vg -wi-a-

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
/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
/dev/sdc1
17.14G 17.09G
/dev/sdd1
17.14G 17.14G
/dev/sdb1
17.14G 17.14G
Attr
Start SSize
0
52.00M
0
8.00M
LSize
Origin Snap%
#Str Type
SSize
1 linear 52.00M
PFree
PFree
#Str Type
Stripe Chunk
1 linear
0
1 linear
0
Move Log Copy%
Sorting LVM Reports
0
8.00K
49

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 4 - LVM ADMINISTRATOR and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Enterprise linux 4

Table of Contents