Chapter 4. LVM Administration with CLI Commands
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
/dev/sdd1
17.14G 17.14G
/dev/sdb1
17.14G 17.14G
/dev/sdc1
17.14G 17.09G
4.9.4. Specifying Units
To specify the unit for the LVM report display, use the --units argument of the report command. You
can specify (b)ytes, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (e)xabytes, (p)etabytes, and
(h)uman-readable. The default display is human-readable. You can override the default by setting the
units parameter in the global section of the lvm.conf file.
The following example specifies the output of the pvs command in megabytes rather than the default
gigabytes.
# pvs --units m
PV
VG
/dev/sda1
/dev/sdb1
new_vg lvm2 a-
/dev/sdc1
new_vg lvm2 a-
/dev/sdd1
new_vg lvm2 a-
By default, units are displayed in powers of 2 (multiples of 1024). You can specify that units be
displayed in multiples of 1000 by capitalizing the unit specification (B, K, M, G, T, H).
The following command displays the output as a multiple of 1024, the default behavior.
# pvs
PV
VG
/dev/sdb1
new_vg lvm2 a-
/dev/sdc1
new_vg lvm2 a-
/dev/sdd1
new_vg lvm2 a-
The following command displays the output as a multiple of 1000.
50
PFree
Fmt
Attr PSize
lvm2 --
17555.40M 17555.40M
17552.00M 17552.00M
17552.00M 17500.00M
17552.00M 17552.00M
Fmt
Attr PSize
17.14G 17.14G
17.14G 17.09G
17.14G 17.14G
PFree
PFree
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