LPIC-2 Practice Question: Block Devices, Filesystems and Advanced Storage
A database server uses LVM with an XFS filesystem on /dev/vg_data/lv_db, mounted at /var/lib/mysql. The LV is at 95% capacity. A new 50GB disk /dev/sdd has been added and initialized as a physical volume, then added to the volume group vg_data. The database is running and cannot be stopped. The administrator must extend the LV and filesystem. What is the correct course of action?
⚠ Common exam trap
The trap here is that candidates mistakenly apply `resize2fs` (which is for ext4) to an XFS filesystem, or forget that XFS requires a separate grow command (`xfs_growfs`) and cannot be resized with `lvextend` alone.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Run `lvextend -L +50G /dev/vg_data/lv_db` followed by `xfs_growfs /var/lib/mysql`.
XFS filesystems must be grown while mounted using `xfs_growfs` with the mount point as the argument, not the block device. Since the database cannot be stopped, the LV can be extended online with `lvextend`, and then `xfs_growfs /var/lib/mysql` resizes the filesystem to fill the expanded LV without requiring unmounting or downtime.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Run `lvextend -L +50G /dev/vg_data/lv_db` followed by `resize2fs /dev/vg_data/lv_db`.
Why it's wrong here
Incorrect: resize2fs is for ext2/3/4 filesystems, not XFS.
- ✓
Run `lvextend -L +50G /dev/vg_data/lv_db` followed by `xfs_growfs /var/lib/mysql`.
Why this is correct
Correct: lvextend extends the LV online, and xfs_growfs resizes the XFS filesystem while mounted.
- ✗
Unmount /var/lib/mysql, run `lvextend -L +50G /dev/vg_data/lv_db`, run `resize2fs /dev/vg_data/lv_db`, then remount.
Why it's wrong here
Incorrect: Unmounting causes database downtime, which is not acceptable; also resize2fs is wrong for XFS.
- ✗
Run `lvresize -L +50G /dev/vg_data/lv_db`.
Why it's wrong here
Incorrect: This extends the LV but does not resize the filesystem, so the added space remains unused.
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.