4.9.4. 指​​​​​​​定​​​​​​​单​​​​​​​位​​​​​​​

要​​​​​​​指​​​​​​​定​​​​​​​ LVM 报​​​​​​​告​​​​​​​显​​​​​​​示​​​​​​​的​​​​​​​单​​​​​​​位​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​报​​​​​​​告​​​​​​​命​​​​​​​令​​​​​​​的​​​​​​​ --units 参​​​​​​​数​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​字​​​​​​​节​​​​​​​(b)、​​​​​​​千​​​​​​​字​​​​​​​节​​​​​​​(k)、​​​​​​​兆​​​​​​​字​​​​​​​节​​​​​​​(m)、​​​​​​​千​​​​​​​兆​​​​​​​字​​​​​​​节​​​​​​​(g)、​​​​​​​兆​​​​​​​兆​​​​​​​字​​​​​​​节​​​​​​​(t)、​​​​​​​艾​​​​​​​字​​​​​​​节​​​​​​​(e)、​​​​​​​拍​​​​​​​字​​​​​​​节​​​​​​​(p)以​​​​​​​及​​​​​​​可​​​​​​​读​​​​​​​。​​​​​​​默​​​​​​​认​​​​​​​显​​​​​​​示​​​​​​​是​​​​​​​可​​​​​​​读​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​通​​​​​​​过​​​​​​​在​​​​​​​ lvm.conf 文​​​​​​​件​​​​​​​的​​​​​​​ global 部​​​​​​​分​​​​​​​设​​​​​​​定​​​​​​​ units 参​​​​​​​数​​​​​​​来​​​​​​​覆​​​​​​​盖​​​​​​​默​​​​​​​认​​​​​​​设​​​​​​​置​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​指​​​​​​​定​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​以​​​​​​​兆​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​,而​​​​​​​不​​​​​​​是​​​​​​​默​​​​​​​认​​​​​​​的​​​​​​​千​​​​​​​兆​​​​​​​为​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​
# pvs --units m
  PV         VG     Fmt  Attr PSize     PFree
  /dev/sda1         lvm2 --   17555.40M 17555.40M
  /dev/sdb1  new_vg lvm2 a-   17552.00M 17552.00M
  /dev/sdc1  new_vg lvm2 a-   17552.00M 17500.00M
  /dev/sdd1  new_vg lvm2 a-   17552.00M 17552.00M
默​​​​​​​认​​​​​​​情​​​​​​​况​​​​​​​下​​​​​​​,单​​​​​​​位​​​​​​​显​​​​​​​示​​​​​​​为​​​​​​​ 2 的​​​​​​​乘​​​​​​​方​​​​​​​(乘​​​​​​​ 1024)。​​​​​​​您​​​​​​​通​​​​​​​过​​​​​​​大​​​​​​​写​​​​​​​单​​​​​​​位​​​​​​​说​​​​​​​明​​​​​​​(B、​​​​​​​K、​​​​​​​M、​​​​​​​G、​​​​​​​T、​​​​​​​H)指​​​​​​​定​​​​​​​将​​​​​​​单​​​​​​​位​​​​​​​显​​​​​​​示​​​​​​​为​​​​​​​乘​​​​​​​ 1000。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​默​​​​​​​认​​​​​​​行​​​​​​​为​​​​​​​,即​​​​​​​乘​​​​​​​ 1024 显​​​​​​​示​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# pvs
  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
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​乘​​​​​​​ 1000 显​​​​​​​示​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
#  pvs --units G
  PV         VG     Fmt  Attr PSize  PFree
  /dev/sdb1  new_vg lvm2 a-   18.40G 18.40G
  /dev/sdc1  new_vg lvm2 a-   18.40G 18.35G
  /dev/sdd1  new_vg lvm2 a-   18.40G 18.40G
您​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​扇​​​​​​​区​​​​​​​(sector,定​​​​​​​义​​​​​​​为​​​​​​​ 512K),或​​​​​​​者​​​​​​​自​​​​​​​定​​​​​​​义​​​​​​​单​​​​​​​位​​​​​​​。​​​​​​​
下​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​以​​​​​​​扇​​​​​​​区​​​​​​​的​​​​​​​数​​​​​​​目​​​​​​​显​​​​​​​示​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​。​​​​​​​
# pvs --units s
  PV         VG     Fmt  Attr PSize     PFree
  /dev/sdb1  new_vg lvm2 a-   35946496S 35946496S
  /dev/sdc1  new_vg lvm2 a-   35946496S 35840000S
  /dev/sdd1  new_vg lvm2 a-   35946496S 35946496S
下​​​​​​​面​​​​​​​的​​​​​​​例​​​​​​​子​​​​​​​显​​​​​​​示​​​​​​​了​​​​​​​ pvs 命​​​​​​​令​​​​​​​的​​​​​​​输​​​​​​​出​​​​​​​结​​​​​​​果​​​​​​​,单​​​​​​​位​​​​​​​为​​​​​​​ 4MB。​​​​​​​
# pvs --units 4m
  PV         VG     Fmt  Attr PSize    PFree
  /dev/sdb1  new_vg lvm2 a-   4388.00U 4388.00U
  /dev/sdc1  new_vg lvm2 a-   4388.00U 4375.00U
  /dev/sdd1  new_vg lvm2 a-   4388.00U 4388.00U