Red Hat Training

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

4.9.4. Come specificare le unità

Per specificare l'unità per il display del riporto di LVM utilizzate --units del comando di riporto. È possibile specificare (b)ytes, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (e)xabytes, (p)etabytes, e (h)uman-readable. L'impostazione predefinita è human-readable. Potrete sovrascrivere l'impostazione predefinita impostando il parametro units nella sezione global del file lvm.conf.
Il seguente esempio specifica l'output di pvs in megabyte e non in gigabytea.
# 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
Per default le unità vengono visualizzate moltiplicate per 2 (multipli di 1024). È possibile specificare la visualizzazione delle unità in multipli di 1000, usando le specifiche dell'unità con la lettera maiuscola (B, K, M, G, T, H).
Il seguente comando mostra l'output come multiplo di 1024, comportamento predefinito.
# 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
Il seguente comando mostra l'output come multiplo di 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
È possibile specificare (s)ectors 'settori' (definiti con 512 byte) oppure le unità personalizzate.
Il seguente esempio mostra l'output del comando pvs come un numero di settori.
# 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
Il seguente esempio mostra l'output del comando pvs in unità di 4 megabyte.
# 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