RHCSA RHCSA LVM Storage Management 3 — Questions and Answers
Question 1: A volume group 'vg0' is full. You add a new disk /dev/sdc. What is the correct sequence to add it to vg0?
- vgextend vg0 /dev/sdc
- pvcreate /dev/sdc, then vgextend vg0 /dev/sdc (Correct answer)
- mkfs /dev/sdc, then vgadd vg0 /dev/sdc
- fdisk /dev/sdc, then vgcreate vg0 /dev/sdc
Correct answer: pvcreate /dev/sdc, then vgextend vg0 /dev/sdc
You must first initialize the disk as a PV with pvcreate, then extend the VG with vgextend.
Question 2: What does the '-s' option specify when running lvcreate for a snapshot?
- The stripe size
- That the LV is a snapshot (Correct answer)
- The size in sectors
- The snapshot interval
Correct answer: That the LV is a snapshot
lvcreate -s (--snapshot) creates a snapshot logical volume of an existing LV.
Question 3: Which command reduces the size of volume group vg0 by removing physical volume /dev/sdb?
- pvremove /dev/sdb
- vgreduce vg0 /dev/sdb (Correct answer)
- vgremove /dev/sdb vg0
- lvreduce vg0 /dev/sdb
Correct answer: vgreduce vg0 /dev/sdb
vgreduce removes a physical volume from a volume group, provided the PV has no allocated extents.
Question 4: You need to move all data off /dev/sdb1 (which is in vg0) to other PVs before removal. Which command does this?
- pvmove /dev/sdb1 (Correct answer)
- vgmove vg0 /dev/sdb1
- lvmigrate /dev/sdb1
- pvtransfer /dev/sdb1
Correct answer: pvmove /dev/sdb1
pvmove relocates all logical extents from the specified physical volume to other PVs in the same VG.
Question 5: What is the default unit for extent size when creating a volume group with vgcreate?
- 1 MB
- 4 MB (Correct answer)
- 8 MB
- 32 MB
Correct answer: 4 MB
The default physical extent size in LVM is 4 MB, though it can be changed with the -s option.
Question 6: Which command merges a snapshot back into its origin logical volume?
- lvmerge
- lvconvert --merge (Correct answer)
- lvsnapshot --merge
- lvchange --merge
Correct answer: lvconvert --merge
lvconvert --merge rolls back the origin LV to the state captured in the snapshot.
Question 7: How do you rename a logical volume from 'old_lv' to 'new_lv' within volume group vg0?
- lvrename vg0 old_lv new_lv (Correct answer)
- lvchange -n new_lv /dev/vg0/old_lv
- mv /dev/vg0/old_lv /dev/vg0/new_lv
- vgrename old_lv new_lv vg0
Correct answer: lvrename vg0 old_lv new_lv
lvrename takes the VG name followed by the old and new LV names to rename the logical volume.
A volume group 'vg0' is full.
You add a new disk /dev/sdc.
What is the correct sequence to add it to vg0?