RHCSA 5.2: LVM physical volumes, volume groups and logical volumes
A volume group with a chosen extent size, a logical volume sized in extents, growing a volume group, and taking LVM apart cleanly.
Before you start
The lab adds two 1 GiB spare disks. They're image files under
/var/lib/le-lab/disks/, attached again at every boot.
/dev/loop40has two empty partitions:/dev/loop40p1(600 MiB) and/dev/loop40p2(300 MiB). Tasks 1 and 2 use them./dev/loop41has two partitions that are physical volumes of a volume groupvgold, with logical volumeslvoneandlvtwo, as tasks 1 and 2 leavevgdata. Task 3 takes it apart, so the first two tasks' results can stay.
Tasks
- Create a volume group
vgdatawith 8 MiB extents on/dev/loop40p1, and a logical volumelvdataof exactly 50 extents. - Add
/dev/loop40p2tovgdata, and create a logical volumelvrestthat uses all the space left. - Remove
lvone,lvtwo, the volume groupvgoldand both its physical volumes (/dev/loop41p1and/dev/loop41p2) cleanly.
Hints
pvcreate,vgcreate -s 8M,lvcreate -l 50 -n;vgdisplay,lvdisplay(Current LE,LV Size).vgextend,lvcreate -l 100%FREE;vgs vgdatashows#PVandVFree.lvremove,vgremove,pvremove;pvs,vgs,lvs,lsblk -f.