Linux+ Linux+ Logical Volume Management (LVM) 3 — Questions and Answers
Question 1: Which command is used to add a physical volume to an existing volume group named vg0?
- vgextend vg0 /dev/sdd (Correct answer)
- vgadd vg0 /dev/sdd
- pvadd /dev/sdd vg0
- vgmodify --add /dev/sdd vg0
Correct answer: vgextend vg0 /dev/sdd
vgextend adds one or more initialized physical volumes to an existing volume group.
Question 2: A mirror logical volume is created with 'lvcreate -m1'. What does the '1' specify?
- Number of additional mirror copies (1 copy = 2 total legs) (Correct answer)
- Number of mirror sets
- Mirror chunk size in MB
- Number of mirror logs
Correct answer: Number of additional mirror copies (1 copy = 2 total legs)
The -m1 option creates 1 additional mirror copy, resulting in 2 total data copies (original + 1 mirror leg).
Question 3: What does the 'pvmove' command do in LVM?
- Moves data extents from one physical volume to another (Correct answer)
- Renames a physical volume path
- Migrates a physical volume to a different volume group
- Converts a physical volume to a regular partition
Correct answer: Moves data extents from one physical volume to another
pvmove relocates physical extents from one PV to others in the same VG, enabling disk evacuation without downtime.
Question 4: Which LVM feature allows a logical volume to store data across multiple physical volumes for performance?
- Striping (Correct answer)
- Mirroring
- Snapshots
- Thin provisioning
Correct answer: Striping
LVM striping (RAID 0) distributes data across multiple PVs in stripes, improving read/write performance.
Question 5: After removing a physical volume from a VG with vgreduce, what state is the PV in?
- It remains initialized as a PV but belongs to no VG (Correct answer)
- It is automatically returned to a raw block device
- It is marked as missing in the LVM database
- It must be re-partitioned before reuse
Correct answer: It remains initialized as a PV but belongs to no VG
After vgreduce, the PV retains its LVM metadata and remains a valid PV but is unassigned and can join another VG.
Question 6: Which command converts an existing linear logical volume to use RAID1 mirroring?
- lvconvert --type raid1 -m1 /dev/vg0/lv1 (Correct answer)
- lvcreate --raid1 /dev/vg0/lv1
- lvchange --mirror 1 /dev/vg0/lv1
- lvmodify --type mirror /dev/vg0/lv1
Correct answer: lvconvert --type raid1 -m1 /dev/vg0/lv1
lvconvert --type raid1 -m1 converts an existing LV to RAID1 with one additional mirror copy in-place.
Question 7: What is the default physical extent size when creating a new volume group?
- 4 MB (Correct answer)
- 1 MB
- 16 MB
- 64 MB
Correct answer: 4 MB
LVM uses a default physical extent size of 4 MB, which can be changed with the -s option during vgcreate.
Which command is used to add a physical volume to an existing volume group named vg0?