RHCSA RHCSA LVM Storage Management 5 — Questions and Answers
Question 1: After importing physical disks from another system, which command makes the volume group available on the new system?
- vgactivate
- vgimport vg0
- vgscan && vgactivate
- vgimport vg0 && vgchange -ay vg0 (Correct answer)
Correct answer: vgimport vg0 && vgchange -ay vg0
vgimport re-registers the VG with the system, then vgchange -ay activates it so LVs can be mounted.
Question 2: What is the purpose of the 'vgcfgrestore' command?
- Restores a VG from a full disk backup
- Restores VG metadata from an archived configuration file (Correct answer)
- Rebuilds corrupted filesystem data on all LVs
- Re-creates missing device nodes for LVs
Correct answer: Restores VG metadata from an archived configuration file
vgcfgrestore restores the LVM metadata for a volume group from a backup stored in /etc/lvm/backup/.
Question 3: Which option with 'lvcreate' creates a thin-provisioned pool named 'thin_pool' in vg0?
- lvcreate -T -L 20G -n thin_pool vg0
- lvcreate --thin -L 20G -n thin_pool vg0
- lvcreate -T -L 20G -n thin_pool vg0
- Both A and C are correct (Correct answer)
Correct answer: Both A and C are correct
-T and --thin are equivalent flags for creating a thin pool; both commands produce the same result.
Question 4: A volume group shows 'partial' status. What does this indicate?
- The VG is partially activated
- One or more PVs in the VG are missing or unavailable (Correct answer)
- The VG has less than 50% free space
- The VG has been exported but not imported
Correct answer: One or more PVs in the VG are missing or unavailable
A 'partial' VG means at least one physical volume member is missing, making some LV data inaccessible.
Question 5: Which lvs output column shows the type of a logical volume (e.g., linear, thin, snapshot)?
- LV_TYPE
- Attr (Correct answer)
- Seg_type
- LV_layout
Correct answer: Attr
The 'Attr' column in lvs output encodes LV type and state using a multi-character attribute string.
Question 6: When shrinking an ext4 logical volume, what must be done BEFORE running lvreduce?
- Activate the LV in read-only mode
- Unmount and run resize2fs to shrink the filesystem first (Correct answer)
- Run pvmove to relocate data
- Take a snapshot of the LV
Correct answer: Unmount and run resize2fs to shrink the filesystem first
The filesystem must be shrunk with resize2fs before lvreduce, or data at the end of the LV will be truncated.
Question 7: What is the effect of running 'vgchange -an vg0'?
- Activates all logical volumes in vg0
- Deactivates all logical volumes in vg0 (Correct answer)
- Deletes the vg0 volume group
- Sets vg0 to auto-activation mode
Correct answer: Deactivates all logical volumes in vg0
vgchange -an deactivates all logical volumes in the specified volume group, making their device nodes unavailable.
After importing physical disks from another system, which command makes the volume group available on the new system?