Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

vgs

Show volume groups: short table (vgs), full details (vgdisplay), or scan for VGs (vgscan).

Niveau
RHCSA-examen
Groep
LVM
Root nodig
Ja
Pakket
lvm2
Ook
vgdisplay, vgscan

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

vgs prints one line per VG: number of PVs and LVs, size and free space. vgdisplay shows the details, including the PE Size and the number of free extents — needed for lvcreate -l.

Zo schrijf je het

vgs [OPTION]... [VG...]
vgdisplay [OPTION]... [VG...]
vgscan [OPTION]...

Opties 28

Meest gebruikt

Report (vgs)

-o, --options COLUMNS
Columns, like vg_name,vg_size,vg_free,vg_extent_size (+col = add).
-O, --sort COLUMNS
Sort.
-S, --select EXPR
Filter, like 'vg_free>10g'.
--units UNIT
Units: h, b, k, m, g, t, e …
--nosuffix
No unit letters.
--noheadings
No header line.
--separator TEXT
Column separator.
--aligned, --rows, --binary, --nameprefixes, --unquoted
Output styles.
-a, --all
Also empty VGs and orphans.
--reportformat basic|json
JSON output.
--configreport, --logonly, --foreign, --shared, --readonly, --ignorelockingfailure, --unbuffered
Special report settings.

vgdisplay

-v, --verbose
Also list the LVs and PVs of the VG.
-C, --columns
Report like vgs.
-s, --short
Short form.
-A, --activevolumegroups
Only active VGs.

vgscan

--mknodes
Create missing /dev nodes for LVs.
--notifydbusd y|n
Notify the D-Bus service.

Common LVM options

-t, --test
Test only; change nothing.
-v, --verbose
More output (repeat for more).
-q, --quiet
Less output.
-y, --yes
Answer yes to questions.
-d, --debug
Debug output.
--config STRING
Override lvm.conf settings for this command only.
--commandprofile STRING, --profile STRING
Use a configuration profile.
--devices PV, --devicesfile STRING
Limit the devices LVM looks at.
--driverloaded y|n, --nolocking, --lockopt STRING, --nohints, --journal STRING
Special and debug settings.
-h, --help, --longhelp
Show help.
--version
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1All VGs

    vgs
      VG     #PV #LV #SN Attr   VSize   VFree
      rhel     1   2   0 wz--n- <19.00g      0
      vgdata   2   1   0 wz--n- <14.99g <9.99g

    VFree = space for new or bigger LVs.

  2. 2Details with PE size

    vgdisplay vgdata

    PE Size, Total PE, Alloc PE, Free PE / Size.

  3. 3Free extents only

    vgs -o vg_name,vg_extent_size,vg_free_count vgdata

    Exactly what lvcreate -l needs.

  4. 4In MiB

    vgs --units m vgdata

    Exact numbers.

  5. 5VG with its LVs and PVs

    vgdisplay -v vgdata

    All in one view.

  6. 6VGs that are almost full (monitoring)

    vgs -S 'vg_free<1g' -o vg_name,vg_free

    Plan to add disks.

  7. 7Script value

    vgs --noheadings --nosuffix --units g -o vg_free vgdata

    A number for checks.

  8. 8JSON

    vgs --reportformat json

    For automation tools.

  9. 9Scan after moving disks between servers

    vgscan; vgchange -ay

    Finds and activates the moved VGs.

  10. 10Check the VG attributes

    vgs -o +vg_attr,vg_systemid

    w = writable, z = resizable, n = normal allocation.

Exitcodes

0Done.
5Error.