LFCS Certification Storage Management with LVM 4 — Questions and Answers
Question 1: Which command renames a volume group from 'vg_old' to 'vg_new'?
- vgchange --name vg_new vg_old
- vgrename vg_old vg_new (Correct answer)
- vgmodify -n vg_new vg_old
- lvrename vg_old vg_new
Correct answer: vgrename vg_old vg_new
vgrename is the dedicated command for renaming volume groups and updates the UUID reference in metadata.
Question 2: After detaching a disk with LVM data to attach to another system, which sequence correctly imports the VG?
- pvscan → vgimport → vgchange -a y (Correct answer)
- pvimport → vgscan → lvscan
- vgscan → vgchange --import → lvscan
- vgchange -a y directly without scanning
Correct answer: pvscan → vgimport → vgchange -a y
pvscan finds the PV, vgimport makes the exported VG available on the new host, and vgchange -a y activates the LVs.
Question 3: What is the default physical extent size when creating a new volume group with 'vgcreate'?
- 1 MB
- 4 MB (Correct answer)
- 8 MB
- 16 MB
Correct answer: 4 MB
LVM defaults to a physical extent size of 4 MiB unless overridden with the -s option during vgcreate.
Question 4: Which file must be updated so that LVM devices are scanned at boot on a system using initramfs?
- /etc/lvm/lvm.conf (Correct answer)
- /etc/fstab
- /boot/grub/grub.cfg
- /etc/initramfs-tools/modules
Correct answer: /etc/lvm/lvm.conf
/etc/lvm/lvm.conf controls LVM behaviour including device filters and scanning; initramfs copies it for early boot activation.
Question 5: How do you convert an existing linear logical volume to a two-way RAID1 mirror using LVM?
- lvcreate --mirrors 1 /dev/vg0/lv_data
- lvconvert --mirrors 1 /dev/vg0/lv_data (Correct answer)
- lvchange --raid1 /dev/vg0/lv_data
- lvmodify -m 2 /dev/vg0/lv_data
Correct answer: lvconvert --mirrors 1 /dev/vg0/lv_data
lvconvert --mirrors 1 converts an existing LV to a mirrored type with one additional copy (total 2 legs).
Question 6: Which command shows the total number of free physical extents in a volume group named vg0?
- pvdisplay vg0
- vgdisplay vg0 (Correct answer)
- lvdisplay vg0
- pvscan --free vg0
Correct answer: vgdisplay vg0
vgdisplay vg0 reports VG-level statistics including total PEs, allocated PEs, and free PEs.
Question 7: A logical volume was accidentally removed. Its VG metadata backup exists. Which command attempts recovery?
- lvrestore --backup /etc/lvm/backup/vg0 vg0/lv_data
- vgcfgrestore -f /etc/lvm/backup/vg0 vg0 (Correct answer)
- vgrestore vg0 /etc/lvm/backup/vg0
- pvcfgrestore /dev/sdb
Correct answer: vgcfgrestore -f /etc/lvm/backup/vg0 vg0
vgcfgrestore restores VG metadata from a backup file, which can re-create accidentally removed LV definitions.
Which command renames a volume group from 'vg_old' to 'vg_new'?