LFCS Certification Storage Management with LVM 2 — Questions and Answers
Question 1: Which command reduces the size of a logical volume named /dev/vg0/lv_data to 10G?
- lvresize -L 10G /dev/vg0/lv_data
- lvreduce -L 10G /dev/vg0/lv_data (Correct answer)
- lvshrink -L 10G /dev/vg0/lv_data
- lvchange -L 10G /dev/vg0/lv_data
Correct answer: lvreduce -L 10G /dev/vg0/lv_data
lvreduce is the dedicated command for shrinking a logical volume, accepting an absolute size with -L.
Question 2: Before shrinking an ext4 filesystem on a logical volume, which step is mandatory?
- Run fsck on the mounted filesystem
- Unmount the filesystem, then run resize2fs to shrink it first (Correct answer)
- Snapshot the LV, then reduce
- Run tune2fs -r before reducing
Correct answer: Unmount the filesystem, then run resize2fs to shrink it first
The filesystem must be unmounted and resized with resize2fs before the logical volume itself is reduced to avoid data corruption.
Question 3: What does the command 'vgextend vg0 /dev/sdc' accomplish?
- Extends lv0 within vg0 using /dev/sdc
- Adds physical volume /dev/sdc to the volume group vg0 (Correct answer)
- Creates a new volume group named vg0 on /dev/sdc
- Mirrors vg0 onto /dev/sdc
Correct answer: Adds physical volume /dev/sdc to the volume group vg0
vgextend adds an already-initialized physical volume to an existing volume group, increasing available space.
Question 4: Which LVM metadata backup file location stores automatic backups of volume group metadata?
- /etc/lvm/backup/ (Correct answer)
- /var/lvm/archive/
- /etc/lvm/archive/
- /boot/lvm/backup/
Correct answer: /etc/lvm/backup/
/etc/lvm/backup/ holds the most recent automatic metadata backup for each volume group.
Question 5: A physical volume /dev/sdb is part of vg0 but has no extents allocated. Which command safely removes it from the VG?
- pvremove /dev/sdb
- vgreduce vg0 /dev/sdb (Correct answer)
- pvdelete /dev/sdb
- vgremove /dev/sdb /dev/sdb
Correct answer: vgreduce vg0 /dev/sdb
vgreduce removes a physical volume from a volume group; pvremove then wipes the PV label entirely.
Question 6: What is the purpose of the 'pvmove /dev/sdb' command?
- Renames the physical volume /dev/sdb
- Migrates all allocated extents off /dev/sdb to other PVs in the same VG (Correct answer)
- Moves the PV label from sdb to another disk
- Converts /dev/sdb from a PV to a plain partition
Correct answer: Migrates all allocated extents off /dev/sdb to other PVs in the same VG
pvmove relocates allocated physical extents from one PV to free extents on other PVs in the volume group without data loss.
Question 7: Which command displays the physical extents allocation map for a specific logical volume?
- lvdisplay -m /dev/vg0/lv_data (Correct answer)
- pvdisplay /dev/vg0/lv_data
- vgdisplay --extents /dev/vg0/lv_data
- lvscan -m /dev/vg0/lv_data
Correct answer: lvdisplay -m /dev/vg0/lv_data
lvdisplay -m (or --maps) shows a segment-by-segment map of which physical extents back each segment of the logical volume.
Which command reduces the size of a logical volume named /dev/vg0/lv_data to 10G?