LFCS Certification Storage Management with LVM 5 — Questions and Answers
Question 1: Which option to 'lvcreate' allocates extents using a contiguous allocation policy?
- --alloc anywhere
- --alloc contiguous (Correct answer)
- --alloc normal
- --alloc cling
Correct answer: --alloc contiguous
The 'contiguous' allocation policy forces all extents of the LV to be physically adjacent on a single PV.
Question 2: What is the effect of running 'lvchange --permission r /dev/vg0/lv_data'?
- Makes the LV read-only (Correct answer)
- Removes read permission from the LV
- Resets the LV to factory permissions
- Restricts root access to the LV
Correct answer: Makes the LV read-only
lvchange --permission r sets the logical volume to read-only mode; 'rw' would restore read-write access.
Question 3: Which command reports the logical volume path, size, and current state in a script-friendly one-line-per-LV format?
- lvscan
- lvs (Correct answer)
- lvdisplay --short
- vgs --lv
Correct answer: lvs
lvs produces a compact, column-oriented report of all LVs suitable for scripting, unlike the verbose lvdisplay format.
Question 4: When using LVM cache (lvmcache), what is the role of the 'cache pool'?
- Stores metadata backups for the main LV
- Acts as a fast-tier device (SSD) that caches frequently accessed blocks of a slow origin LV (Correct answer)
- Provides thin-provisioned space to multiple LVs
- Holds the CoW data for snapshots
Correct answer: Acts as a fast-tier device (SSD) that caches frequently accessed blocks of a slow origin LV
An LVM cache pool resides on fast storage (e.g., SSD) and transparently caches hot blocks from a slower origin logical volume.
Question 5: A volume group vg0 has PVs on /dev/sdb and /dev/sdc. Which command moves all extents from /dev/sdc to /dev/sdb before removing /dev/sdc?
- pvmove /dev/sdc /dev/sdb (Correct answer)
- vgreduce --move /dev/sdc /dev/sdb vg0
- pvtransfer /dev/sdc /dev/sdb
- lvmove vg0 /dev/sdc /dev/sdb
Correct answer: pvmove /dev/sdc /dev/sdb
pvmove accepts an optional destination PV; specifying /dev/sdb forces all migrated extents onto that device.
Question 6: What does the 'vgsplit' command do in LVM?
- Splits a logical volume into two equal halves
- Moves one or more PVs along with their LVs from one VG into a new VG (Correct answer)
- Divides a VG's free space evenly between two new VGs
- Separates metadata from data in a VG
Correct answer: Moves one or more PVs along with their LVs from one VG into a new VG
vgsplit extracts specified physical volumes (and any LVs that reside entirely on them) into a newly created volume group.
Question 7: Which option to 'lvcreate' creates a thin logical volume of 50G from an existing thin pool 'tp0' in vg0?
- lvcreate -V 50G --thin -n lv_thin vg0/tp0 (Correct answer)
- lvcreate -L 50G --thin -n lv_thin vg0/tp0
- lvcreate -V 50G -T -n lv_thin vg0
- lvcreate --thinpool tp0 -L 50G -n lv_thin vg0
Correct answer: lvcreate -V 50G --thin -n lv_thin vg0/tp0
-V specifies the virtual size of the thin LV while --thin and the pool path vg0/tp0 identify the backing thin pool.
Which option to 'lvcreate' allocates extents using a contiguous allocation policy?