Show Table of Contents
4.8.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

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.