Menu Close

Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

4.9.4. 指​​​​​​​定​​​​​​​單​​​​​​​位​​​​​​​

若​​​​​​​要​​​​​​​為​​​​​​​ LVM 回​​​​​​​報​​​​​​​顯​​​​​​​示​​​​​​​指​​​​​​​定​​​​​​​單​​​​​​​位​​​​​​​,請​​​​​​​使​​​​​​​用​​​​​​​回​​​​​​​報​​​​​​​指​​​​​​​令​​​​​​​的​​​​​​​ --units 引​​​​​​​數​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​指​​​​​​​定​​​​​​​ (b)ytes、​​​​​​​(k)ilobytes、​​​​​​​(m)egabytes、​​​​​​​(g)igabytes、​​​​​​​(t)erabytes、​​​​​​​(e)xabytes、​​​​​​​(p)etabytes、​​​​​​​以​​​​​​​及​​​​​​​ (h)uman-readable。​​​​​​​預​​​​​​​設​​​​​​​的​​​​​​​顯​​​​​​​示​​​​​​​為​​​​​​​ human-readable。​​​​​​​您​​​​​​​可​​​​​​​透​​​​​​​過​​​​​​​在​​​​​​​ lvm.conf 檔​​​​​​​案​​​​​​​的​​​​​​​ global 部​​​​​​​份​​​​​​​中​​​​​​​設​​​​​​​定​​​​​​​ units 這​​​​​​​個​​​​​​​參​​​​​​​數​​​​​​​來​​​​​​​置​​​​​​​換​​​​​​​預​​​​​​​設​​​​​​​值​​​​​​​。​​​​​​​
下​​​​​​​列​​​​​​​範​​​​​​​例​​​​​​​指​​​​​​​定​​​​​​​了​​​​​​​ pvs 指​​​​​​​令​​​​​​​的​​​​​​​輸​​​​​​​出​​​​​​​為​​​​​​​ MB 而​​​​​​​非​​​​​​​預​​​​​​​設​​​​​​​的​​​​​​​ GB。​​​​​​​
# 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
您​​​​​​​亦​​​​​​​可​​​​​​​指​​​​​​​定​​​​​​​區​​​​​​​段​​​​​​​(s)(定​​​​​​​義​​​​​​​為​​​​​​​ 512 位​​​​​​​元​​​​​​​組​​​​​​​)或​​​​​​​是​​​​​​​自​​​​​​​訂​​​​​​​單​​​​​​​位​​​​​​​。​​​​​​​
下​​​​​​​列​​​​​​​範​​​​​​​例​​​​​​​將​​​​​​​ 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 指​​​​​​​令​​​​​​​的​​​​​​​輸​​​​​​​出​​​​​​​以​​​​​​​ 4 MB 為​​​​​​​單​​​​​​​位​​​​​​​的​​​​​​​方​​​​​​​式​​​​​​​顯​​​​​​​示​​​​​​​出​​​​​​​。​​​​​​​
# 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