11.3 Assign Physical Volumes to Volume Groups

Key Takeaways

  • Create a volume group with vgcreate VGNAME PV [PV...]; add capacity later with vgextend; remove a PV from a VG with vgreduce.
  • Inspect with vgs and vgdisplay: VSize/VFree (or size/free) show capacity available for new logical volumes.
  • A VG pools one or more PVs into a single allocation space; PE (physical extent) size is set at vgcreate time (default often 4 MiB).
  • Never vgreduce away a PV that still holds extents without pvmove or freeing LVs; exam layouts usually make reduce straightforward when asked.
  • VG metadata is persistent on its PVs; after reboot, VGs activate with the LVM stack—verify with vgs that names and free space match the task.
Last updated: August 2026

11.3 Assign Physical Volumes to Volume Groups

Quick Answer: Build a pool with vgcreate myvg /dev/sdb1. Grow it with vgextend myvg /dev/sdc1. Shrink membership with vgreduce myvg /dev/sdc1. Check vgs / vgdisplay for size and free space. The VG name you choose becomes part of later LV paths like /dev/myvg/data and /dev/mapper/myvg-data.

Official skill focus

EX200 Configure local storage includes assigning physical volumes to volume groups. In plain language: take one or more PVs and combine them into a named pool of extents from which you create logical volumes.

Typical tasks:

  • “Create a volume group named research using /dev/sdb1.”
  • “Add /dev/sdc1 to volume group research.”
  • “Remove /dev/sdd1 from research.”

Create a volume group: vgcreate

sudo vgcreate research /dev/sdb1
sudo vgcreate research /dev/sdb1 /dev/sdc1    # multi-PV from the start
sudo vgcreate -s 16M research /dev/sdb1      # custom PE size (advanced; default usually OK)

Rules of thumb:

  • VG name must be unique on the system (rhel or rl may already exist for root).
  • Arguments after the name are PVs (devices already pvcreate’d).
  • Do not use a PV that already belongs to another VG.

Verify:

sudo vgs
sudo vgdisplay research
sudo pvs
# /dev/sdb1 should now show VG research

Reading vgs

  VG       #PV #LV #SN Attr   VSize   VFree
  research   1   0   0 wz--n-  20.00g  20.00g
  rhel       1   2   0 wz--n- <39.00g  <3.00g
FieldMeaning
VGVolume group name
#PV / #LVCounts of physical and logical volumes
VSizeTotal VG capacity
VFreeFree space for new or extended LVs

If the task only creates a VG, #LV may be 0 and VFree ≈ VSize. That is success.

Extend a volume group: vgextend

When you need more pool capacity:

sudo pvcreate /dev/sdc1          # if not already a PV
sudo vgextend research /dev/sdc1
sudo vgs research
sudo pvs

vgextend is the day-2 operation matching “add this disk to the existing VG.” It does not automatically grow filesystems; it only adds free extents to the VG. Growing an LV/filesystem is a separate skill (often lvextend + xfs_growfs in a later objective).

Reduce a volume group: vgreduce

sudo vgreduce research /dev/sdc1

Preconditions:

  • No allocated extents remaining on that PV (or LVM cannot release it).
  • If allocations exist, move them: sudo pvmove /dev/sdc1 (needs free space on other PVs in the VG), then vgreduce.
sudo pvs -o+pv_used,pv_free
sudo pvmove /dev/sdc1
sudo vgreduce research /dev/sdc1
sudo pvremove /dev/sdc1    # only if task also wants PV removed

Empty VG removal (if task says delete the VG entirely—adjacent skill):

sudo lvremove ...          # remove LVs first
sudo vgremove research

Focus this section on assign/extend/reduce membership; full teardown order is good hygiene for labs.

Physical extents (PE) — enough theory for the exam

A VG chops PV space into physical extents (default commonly 4 MiB). Logical volumes are allocated in whole extents. Practical implications:

  • Requested LV sizes round to extent boundaries.
  • vgs free space is what you can still allocate.
  • Custom -s at vgcreate is rarely required unless a task specifies extent size.
sudo vgdisplay research | egrep 'PE Size|Total PE|Free  PE|VG Size'

Naming and device paths

ObjectExample
VG nameresearch
Later LVresearch/data
Kernel DM node/dev/mapper/research-data
Convenience symlink/dev/research/data

Hyphens in VG or LV names are doubled in mapper paths (LVM escaping). Prefer simple names (data, vgdata, research) on the exam to avoid confusion.

Do not confuse:

  • /dev/sdb1 — PV
  • research — VG (not a block device you mkfs directly)
  • /dev/mapper/research-data — LV (after lvcreate)

Non-destructive exam mindset

  1. List existing VGs first: sudo vgs — avoid clashing with rhel/rl root VG.
  2. Only consume free PVs shown by pvs with empty or intended VG fields.
  3. Prefer adding a new VG for lab tasks rather than extending the system VG unless the task says so.
  4. Extending the root VG is allowed when asked (“add free space on /dev/sdb1 to rhel”)—still double-check the name.
sudo vgs
sudo pvs
# Task: add /dev/sdb1 to existing VG rhel
sudo vgextend rhel /dev/sdb1
sudo vgs rhel

Activation awareness

Normally VGs activate at boot via systemd/LVM generators. Manual tools:

sudo vgchange -ay
sudo vgchange -ay research
sudo vgchange -an research    # deactivate (no open LVs)

If vgs shows the VG but LVs are missing under /dev/mapper, check activation and lvscan. Cold exam images almost always auto-activate local VGs.

End-to-end exam scenarios

Scenario A — New VG from one PV

Task: Create VG tools on /dev/vdb1.

sudo pvs | grep vdb1
sudo vgcreate tools /dev/vdb1
sudo vgs tools
# VFree should approximately equal PV size (minus tiny metadata overhead)

Scenario B — Multi-PV VG

Task: Create backupvg using /dev/sdb1 and /dev/sdc1.

sudo pvcreate /dev/sdb1 /dev/sdc1   # if needed
sudo vgcreate backupvg /dev/sdb1 /dev/sdc1
sudo vgs backupvg
# #PV should be 2; VSize ≈ sum of PVs

Scenario C — Extend existing VG

Task: Add /dev/sdd1 to backupvg.

sudo pvcreate /dev/sdd1
sudo vgextend backupvg /dev/sdd1
sudo pvs
sudo vgs backupvg

Scenario D — Reduce PV out of VG

Task: Remove /dev/sdd1 from backupvg (assume no LVs use it, or free).

sudo vgreduce backupvg /dev/sdd1
sudo pvs   # sdd1 free or only PV without VG

Verification checklist

CheckCommand
VG exists with correct namevgs / vgdisplay NAME
Correct PVs insidepvs or vgdisplay -v
Free space available for LVsvgs -o+vg_free
Survives rebootreboot lab → vgs again

Sample verbose membership:

sudo vgdisplay -v research

Persistence and scoring

VG metadata is stored in LVM headers on member PVs. After vgcreate/vgextend/vgreduce, changes persist across reboot without editing /etc/fstab. Graders look for the named VG, membership, and free size—not whether you also mounted a filesystem (unless the combined task requires it).

If you create a VG but never create an LV, that is fine when the objective stops at VG assignment. Do not leave partial wrong names (Research vs research—use the exact case requested).

Common traps

  1. vgcreate with a partition that is not a PV — run pvcreate first.
  2. Name collision with existing VG.
  3. vgextend on a device still containing a filesystem signature but not pvcreate’d — initialize PV properly.
  4. vgreduce while extents remainpvmove or delete/move LVs first.
  5. Extending root VG by accident when a new VG was required (or the reverse).
  6. Thinking vgextend grows / automatically — it only adds free PE; LV+FS extend is separate.
  7. Typos in VG name propagating into later lvcreate -n paths.

Coordination with surrounding skills

  • Before: GPT partitions + pvcreate (11.1–11.2).
  • After: lvcreate / lvremove (11.4), then filesystems, fstab, and non-destructive growth objectives in the next chapter.
  • Swap/LV on VG: still needs lvcreate then mkswap/swapon or filesystem tools.

Section checkpoint

You should create volume groups with vgcreate, expand them with vgextend, remove PVs with vgreduce, verify pool size and membership with vgs/vgdisplay/pvs, protect the system VG unless tasked otherwise, and understand that VG changes persist on disk for reboot. That is the EX200 standard for assigning physical volumes to volume groups.

Test Your Knowledge

Which command creates a volume group named research using physical volume /dev/sdb1?

A
B
C
D
Test Your Knowledge

What is the primary effect of vgextend appvg /dev/sdc1?

A
B
C
D
Test Your Knowledge

vgreduce fails because the PV still has allocated extents. What is the usual remediation path?

A
B
C
D
Test Your Knowledge

After vgcreate project /dev/vdb1, which check best confirms success for a task that only required the volume group?

A
B
C
D