11.2 Create and Remove Physical Volumes
Key Takeaways
- A physical volume (PV) is a disk or partition initialized for LVM with pvcreate; list with pvs, pvdisplay, and lsblk.
- Prefer creating PVs on partitions with LVM type (or whole unused disks when the task allows); never pvcreate the wrong device that holds root without explicit need.
- Remove PVs with pvremove only when they are free of volume-group membership (or after vgreduce); wipe signatures carefully.
- pvs shows compact attributes (size, free, VG name); empty VG column means the PV is free for vgcreate/vgextend.
- PV metadata lives on the device; creation is persistent across reboot, but usable storage still requires VG/LV/filesystem layers and correct mounts for user data.
11.2 Create and Remove Physical Volumes
Quick Answer: Initialize LVM on a disk or partition with
pvcreate /dev/NAME. Inventory withpvs,pvdisplay, andlsblk. Remove an unused PV withpvremove. A PV is only the first LVM layer—next you assign it to a volume group (Section 11.3). On EX200, create PVs only on authorized free devices.
Where PVs sit in the LVM stack
LVM (Logical Volume Manager) builds capacity in layers:
| Layer | Object | Common tools |
|---|---|---|
| 1 | Physical volume (PV) | pvcreate, pvremove, pvs, pvdisplay, pvmove |
| 2 | Volume group (VG) | vgcreate, vgextend, vgreduce, vgs |
| 3 | Logical volume (LV) | lvcreate, lvremove, lvs, lvextend |
User-visible filesystems usually sit on LVs (or on plain partitions). Device-mapper exposes LVs under /dev/mapper/vgname-lvname and often /dev/vgname/lvname symlinks.
Official study points include creating and removing physical volumes—you must do this cleanly even when a single task also asks for VG/LV later.
Prerequisites: a usable block device
A PV target is typically:
- A partition (preferred for clarity), e.g.
/dev/sdb1with GPT type LVM (8e00/ lvm flag), or - A whole disk (when the task says use the entire disk and nothing else is on it), e.g.
/dev/sdc.
lsblk
sudo parted /dev/sdb print
# Ensure you are not targeting the root PV or an active mount
findmnt /dev/sdb1
sudo pvs
If the device still has an old filesystem signature, pvcreate may refuse or warn:
sudo wipefs -a /dev/sdb1 # ONLY when task allows destroying existing FS on that partition
sudo pvcreate /dev/sdb1
Use wipefs only on the spare device the task authorizes. It is a data-destroying command.
Create physical volumes: pvcreate
sudo pvcreate /dev/sdb1
sudo pvcreate /dev/sdb1 /dev/sdc1 # multiple at once
sudo pvcreate --dataalignment 1m /dev/sdb1 # occasional alignment option; defaults usually fine
Success messages mention a new physical volume. Verify immediately:
sudo pvs
sudo pvs -o+pv_all
sudo pvdisplay /dev/sdb1
lsblk -f /dev/sdb1
Reading pvs output
PV VG Fmt Attr PSize PFree
/dev/sdb1 lvm2 --- 20.00g 20.00g
/dev/sda2 rhel lvm2 a-- <39.00g <10.00g
| Column | Meaning |
|---|---|
| PV | Device path |
| VG | Volume group membership; empty if free |
| Fmt | Usually lvm2 |
| PSize / PFree | Capacity and free extents still available to the VG |
A free PV (blank VG) is ready for vgcreate or vgextend. A PV already in rhel (or another VG) is not free—do not pvremove it without reducing the VG first.
pvdisplay for detail
sudo pvdisplay
sudo pvdisplay /dev/sdb1
Shows PE size context once in a VG, UUID of the PV, allocatable state, and free PE counts. Useful when pvs is too terse for troubleshooting.
Multiple PVs and exam sizing
Tasks often say: “Create physical volumes on /dev/sdb1 and /dev/sdc1.”
sudo pvcreate /dev/sdb1 /dev/sdc1
sudo pvs
Sizes come from the underlying partition/disk size. You do not pass “2G” to pvcreate—you size the partition first (Section 11.1), then pvcreate consumes that whole device for LVM metadata + allocatable space.
Remove physical volumes: pvremove
sudo pvremove /dev/sdb1
Requirements for a clean remove:
- PV is not in a VG, or you already ran
vgreduceso it left the VG - No open LVs depending on remaining PE layout in a way that still needs this PV (after reduce, free PVs are removable)
If the PV is still in a VG:
sudo pvs
# /dev/sdb1 is listed under VG data
sudo vgreduce data /dev/sdb1 # must have enough free PE on other PVs if LVs used space here
sudo pvremove /dev/sdb1
If extents still live on that PV, vgreduce fails until you pvmove extents off or remove/shrink LVs. EX200 tasks that ask you to remove a PV usually provide a free PV or a simple lab layout without full disks of immovable data—read errors carefully.
Force options exist (pvremove -ff) for broken metadata emergencies. Prefer fixing VG membership properly; force flags are last resorts and can leave inconsistent states if misused.
Signatures, filters, and “device is busy”
| Symptom | Approach |
|---|---|
Device /dev/sdb1 excluded by a filter | Check lvm.conf filters (rare on stock exam images); ensure device path is correct |
Can't open / busy | Unmount filesystems, swapoff, stop using the device |
Device has a signature | Confirm task allows wipe; wipefs -a then pvcreate |
| Wrong size | You pvcreate’d a tiny partition—fix partition size, not LVM PE math yet |
Also confirm you did not create a PV on an LV by accident (possible but usually wrong for EX200 beginner tasks).
Whole disk vs partition PVs
Partition PV (common teaching pattern):
sudo parted /dev/sdb --script mklabel gpt
sudo parted /dev/sdb --script mkpart primary 1MiB 100%
sudo parted /dev/sdb --script set 1 lvm on
sudo pvcreate /dev/sdb1
Whole-disk PV (when task allows):
sudo pvcreate /dev/sdb
Some admins avoid whole-disk PVs because other OS tools expect a partition table; both appear in real life. On the exam, match the task. If it says “partition,” do not skip to whole-disk PV.
Relationship to /dev/mapper names
After only pvcreate, you typically do not yet have a new /dev/mapper/* node for user data—the mapper devices appear when logical volumes (or other DM targets) are active. pvs still lists /dev/sdb1. Do not look for /dev/mapper/sdb1 as a PV name.
Root systems often already show:
/dev/mapper/rhel-root
/dev/mapper/rhel-swap
Those are LVs on PVs that already exist (often /dev/sda2 or similar). Treat them as sacred unless the exam explicitly extends or modifies that VG.
End-to-end exam scenarios
Scenario A — Single new PV
Task: Create a physical volume on /dev/vdb1.
lsblk /dev/vdb
sudo pvcreate /dev/vdb1
sudo pvs /dev/vdb1
Scenario B — Prepare two free PVs for a future VG
sudo pvcreate /dev/sdb1 /dev/sdc1
sudo pvs
# VG column empty for both
Scenario C — Remove a free PV
Task: Remove the physical volume on /dev/sdd1 (not part of any VG).
sudo pvs
sudo pvremove /dev/sdd1
sudo pvs
# device no longer listed as PV; partition may still exist
Scenario D — Cannot remove because still in VG
sudo pvremove /dev/sdb1
# Error: PV still in use
sudo vgs; sudo pvs
sudo vgreduce myvg /dev/sdb1
sudo pvremove /dev/sdb1
Verification checklist (grade yourself)
pvsshows the device withlvm2format.- Size matches the partition/disk you intended.
- VG column empty if you were only asked to create a PV (or correct VG if already extended—know which task you finished).
lsblk -fmay showLVM2_memberas FSTYPE on the PV device.- After reboot,
pvsstill lists the PV (metadata on disk).
Persistence notes
- PV labels/metadata are written to the device → survive reboot.
- Removing a PV with
pvremovealso persists (metadata gone). - No
/etc/fstabentry is required for the PV itself. - Applications do not store files on a bare PV; they use filesystems on LVs or partitions. If the exam task ends at “create PV,” stop and verify with
pvs—do not invent mounts.
Common traps
pvcreate /dev/sdbwhen partitions exist — may destroy partition table depending on usage; be intentional.pvcreateon the root disk partition that is already a PV — dangerous/redundant.- Forgetting that size is set at partition time —
pvcreatedoes not take-L 2Gfor “make PV 2G” the waylvcreatedoes. pvremovewhile VG still owns the PV — reduce first.- Confusing
pvswithvgs/lvs— wrong layer when verifying. - Assuming LVM_member means a mountable filesystem — you still need LV + mkfs + mount for file storage.
Section checkpoint
You should select a free partition or disk, run pvcreate, confirm with pvs/pvdisplay, understand empty vs in-use VG columns, and remove PVs safely with pvremove after vgreduce when needed. That completes the EX200 physical-volume skill and sets up volume group assignment.
Which command initializes /dev/sdb1 as an LVM physical volume?
In pvs output, what does a blank VG column for /dev/sdc1 usually mean?
You must remove PV /dev/sdb1 that still belongs to volume group appvg. What is the correct order?
Why does pvcreate not accept a size like -L 5G the way lvcreate does?