الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

vgextend

Add physical volumes to a volume group (vgextend), or remove them (vgreduce).

المستوى
امتحان RHCSA
المجموعة
LVM
يحتاج root
نعم
الحزمة
lvm2
يُسمّى أيضًا
vgreduce

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

ماذا يفعل

vgextend VG PV... adds new space to a VG while everything runs. Devices that are not PVs yet are initialized for you. vgreduce VG PV removes a PV — it must be empty first (pvmove moves its data to the other PVs).

طريقة الكتابة

vgextend [OPTION]... VG PV...
vgreduce [OPTION]... VG PV...
vgreduce --removemissing VG

الخيارات 20

الأكثر استخدامًا

vgextend

--restoremissing
Add back a PV that was missing.
-f, --force
Force.
-A, --autobackup y|n
Back up the metadata.
--metadatasize SIZE, --pvmetadatacopies N, --metadataignore y|n, --dataalignment SIZE, --dataalignmentoffset SIZE, --labelsector N, -M, --metadatatype lvm2, -Z, --zero y|n
Settings for PVs created on the fly.
--reportformat basic|json
Output format.

vgreduce

-a, --all
Remove all empty PVs.
--removemissing
Remove PVs that are gone (failed disk).
--mirrorsonly
With --removemissing: only mirror images.
-f, --force
Force (with --removemissing: also remove LVs on the missing PV).

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.

أمثلة 10

$ مستخدم عادي# بصلاحية root (أو مع sudo)

  1. 1Add a disk to a VG

    vgextend vgdata /dev/vdd
      Volume group "vgdata" successfully extended

    The new space is free for LVs at once.

  2. 2Check the new size

    vgs vgdata

    VFree is bigger.

  3. 3Then grow an LV

    lvextend -r -l +100%FREE /dev/vgdata/lvdata

    Uses all new space.

  4. 4Remove a disk from a VG

    pvmove /dev/vdc
    vgreduce vgdata /dev/vdc

    pvmove first; vgreduce refuses PVs in use.

  5. 5Remove all empty PVs

    vgreduce -a vgdata

    Cleans unused disks out of the VG.

  6. 6A disk died

    vgreduce --removemissing vgdata

    Lets the VG work again; LVs on that disk are lost (use --force to drop them).

  7. 7Test before

    vgreduce -t vgdata /dev/vdc

    Shows what would happen.

  8. 8Replace an old disk with a new one (no downtime)

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

    Classic migration to new storage.

  9. 9Wipe the removed disk

    pvremove /dev/vdc

    Removes the LVM label.

  10. 10Check which PVs are empty

    pvs -o pv_name,vg_name,pv_used

    pv_used 0 = can be removed.

رموز الخروج

0Done.
5Error.