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

pvmove

Move the data of a physical volume to other PVs in the same VG — while the LVs stay in use.

Niveau
Dagelijks Linux
Groep
LVM
Root nodig
Ja
Pakket
lvm2

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

Wat het doet

pvmove PV moves all used extents from that PV to free space on the other PVs of the VG. Then you can remove the PV with vgreduce — the way to replace a disk without downtime. With a target PV (pvmove OLD NEW) the data goes there. A move can be stopped and continued.

Zo schrijf je het

pvmove [OPTION]... SOURCE_PV[:PE...] [DEST_PV...]
pvmove --abort

Opties 20

Meest gebruikt

-n, --name LV
Move only the extents of this LV.
-b, --background
Run in the background.
-i, --interval SECONDS
How often to show progress.
--abort
Stop all running moves.
--atomic
Move all LVs at once (all or nothing).
--alloc POLICY
Allocation policy for the new place.
-A, --autobackup y|n
Back up the metadata.
--noudevsync
Do not wait for udev.
--reportformat basic|json
Output format.

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. 1Empty a PV

    pvmove /dev/vdc
      /dev/vdc: Moved: 23.53%
      /dev/vdc: Moved: 100.00%

    The VG needs enough free space on other PVs.

  2. 2Move to a chosen PV

    pvmove /dev/vdc /dev/vde

    New disk first added with vgextend.

  3. 3Then remove the PV

    vgreduce vgdata /dev/vdc; pvremove /dev/vdc

    The disk can now be removed.

  4. 4Move only one LV

    pvmove -n lvdata /dev/vdc /dev/nvme0n1p3

    Put a busy LV on a faster disk.

  5. 5In the background

    pvmove -b /dev/vdc
    lvs -a -o name,copy_percent

    Watch the progress with lvs.

  6. 6Continue after an interruption

    pvmove

    Without arguments it continues unfinished moves.

  7. 7Stop a move

    pvmove --abort

    The data stays where it was safe.

  8. 8Check that the PV is empty

    pvs -o pv_name,pv_used /dev/vdc

    pv_used 0 = empty.

  9. 9Full disk replacement in one go

    vgextend vgdata /dev/vde && pvmove /dev/vdc /dev/vde && vgreduce vgdata /dev/vdc

    Old storage array to new one.

  10. 10Move a range of extents

    pvmove /dev/vdc:0-999 /dev/vde

    Fine control (rarely needed).

Exitcodes

0Done.
5Error.