LFCS Storage Management Practice Question
An administrator needs to add a new 8 GB swap area on a server that already has a 2 GB swap partition. The system has free space in the volume group vg_sys. Which command creates a logical volume named lv_swap of exactly 8 GB and prepares it for swap use?
⚠ Common exam trap
Candidates often confuse the lvcreate -l (lowercase, extents) and -L (uppercase, size) options, which leads to creating a volume far smaller than intended.
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
✓
lvcreate -L 8G -n lv_swap vg_sys && mkswap /dev/vg_sys/lv_swap && swapon /dev/vg_sys/lv_swap
The correct procedure is to create the logical volume with lvcreate -L 8G -n lv_swap vg_sys, initialize it with mkswap, and activate it with swapon. The -L option specifies an absolute size in gigabytes, which matches the 8 GB requirement. Persistent activation requires an /etc/fstab entry, but the immediate creation and activation sequence is as shown.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
lvcreate -L 8G -n lv_swap vg_sys && mkswap /dev/vg_sys/lv_swap && swapon /dev/vg_sys/lv_swap
Why this is correct
lvcreate -L 8G -n lv_swap vg_sys creates the 8 GB logical volume in the specified volume group, mkswap writes the swap signature, and swapon activates it immediately. This is the complete correct sequence for adding a swap LV. To persist across reboots, an entry in /etc/fstab would also be needed, but the question asks about creating and preparing the area.
- ✗
vgcreate -L 8G -n lv_swap vg_sys && mkswap /dev/vg_sys/lv_swap && swapon /dev/vg_sys/lv_swap
Why it's wrong here
vgcreate creates a volume group, not a logical volume, and it does not accept -L or -n in that way. The volume group vg_sys already exists, so creating it again is wrong. The subsequent mkswap and swapon commands would reference a device that was never created, so the swap area would not exist.
- ✗
lvcreate -L 8G -n lv_swap vg_sys && mkfs.swap /dev/vg_sys/lv_swap && swapon /dev/vg_sys/lv_swap
Why it's wrong here
mkfs.swap is not a valid command on Linux; swap areas are initialized with mkswap. The lvcreate portion correctly makes the 8 GB logical volume, but the initialization step fails. Without a valid swap signature, swapon will refuse to activate the device, so the intended swap space never becomes available.
- ✗
lvcreate -l 8 -n lv_swap vg_sys && mkswap /dev/vg_sys/lv_swap && swapon -a
Why it's wrong here
The -l option specifies a number of extents, not gigabytes, so -l 8 creates an LV of only 8 extents (typically 32 MB with 4 MB extents). That is far smaller than the required 8 GB. Also, swapon -a enables all swap entries listed in /etc/fstab, which may not include the new LV yet, so it would not reliably activate the new swap area.
Go deeper
Related to this question
About these practice questions
This LFCS question is part of Courseiva's 406-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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.