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

pvs

Show physical volumes: short table (pvs), full details (pvdisplay), or scan for PVs (pvscan).

Niveau
RHCSA-examen
Groep
LVM
Root nodig
Ja
Pakket
lvm2
Ook
pvdisplay, pvscan

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

Wat het doet

pvs prints one line per PV with its VG, size and free space. pvdisplay shows all details (PE size, total and free PEs, UUID). With -o you choose report columns and with -S you filter. pvscan scans devices for PVs and can trigger auto-activation.

Zo schrijf je het

pvs [OPTION]... [PV...]
pvdisplay [OPTION]... [PV...]
pvscan [OPTION]...

Opties 34

Meest gebruikt

Report (pvs, also lvs/vgs)

-o, --options COLUMNS
Columns, like pv_name,vg_name,pv_size,pv_free (+col = add).
-O, --sort COLUMNS
Sort by columns (-col = descending).
-S, --select EXPR
Filter, like 'pv_free>1g'.
--units UNIT
Units: h, b, k, m, g, t, s (sectors), e (extents)… capital = powers of 1000.
--nosuffix
No unit letters (for scripts).
--noheadings
No header line.
--separator TEXT
Column separator.
--aligned
Align with a separator.
--nameprefixes, --unquoted
Output as NAME=value pairs.
--rows
Columns as rows.
--segments
One line per segment.
-a, --all
Also devices that are not PVs.
--binary
0/1 instead of words.
--reportformat basic|json
JSON output.
--configreport log|vg|lv|pv|pvseg|seg, --logonly
Report details.
--foreign, --shared, --readonly, --ignorelockingfailure, --unbuffered
Special report settings.

pvdisplay

-m, --maps
Show which extents belong to which LV.
-C, --columns
Report like pvs.
-s, --short
Only the device and size.

pvscan

--cache
Update the device cache and auto-activation.
-a, --activate ay
Activate VGs that become complete.
-n, --novolumegroup
Only PVs without a VG.
-e, --exported
Only PVs of exported VGs.

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 PVs

    pvs
      PV         VG     Fmt  Attr PSize   PFree
      /dev/vda2  rhel   lvm2 a--  <19.00g      0
      /dev/vdb1  vgdata lvm2 a--   <5.00g   1.00g

    PFree = free space on that PV.

  2. 2Details of one PV

    pvdisplay /dev/vdb1

    PE Size, Total PE, Free PE, Allocated PE, UUID.

  3. 3Which LVs use this PV?

    pvdisplay -m /dev/vdb1

    Needed before you remove a disk.

  4. 4Own columns

    pvs -o pv_name,vg_name,pv_size,pv_free,dev_size

    dev_size shows the size of the device itself.

  5. 5PVs with free space

    pvs -S 'pv_free>0'

    Where can new LVs go?

  6. 6Sizes in MiB for scripts

    pvs --units m --nosuffix --noheadings -o pv_free /dev/vdb1

    Just a number.

  7. 7JSON

    pvs --reportformat json

    For automation.

  8. 8PVs not in any VG

    pvscan -n

    New disks ready to use.

  9. 9Scan after adding disks

    pvscan --cache

    Updates LVM's view of devices.

  10. 10Segments of a PV

    pvs --segments -o +lv_name

    Which LV uses which extents.

Exitcodes

0Done.
5Error.