LPIC-1 System Architecture Practice Question
Exhibit
Refer to the exhibit. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 233.8G 0 disk ├─sda1 8:1 0 512M 0 part /boot ├─sda2 8:2 0 230G 0 part / └─sda3 8:3 0 2.8G 0 part [SWAP] sdb 8:16 0 931.5G 0 disk └─sdb1 8:17 0 931.5G 0 part /data
The system administrator wants to add a new swap partition on /dev/sdb2. After creating the partition, which command should be used to initialize it as swap?
⚠ Common exam trap
Many exam-takers confuse `swapon` (which activates swap) with `mkswap` (which initializes it), mistakenly thinking `swapon` can both prepare and enable the swap area.
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
✓
mkswap /dev/sdb2
The `mkswap` command is specifically designed to initialize a partition or file as a swap area by writing a swap signature (UUID and swap superblock) to the device. After creating the partition, you must run `mkswap /dev/sdb2` to set it up for use as swap before activating it with `swapon`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
mkfs.ext4 /dev/sdb2
Why it's wrong here
This creates an ext4 filesystem, not swap.
- ✗
fsck /dev/sdb2
Why it's wrong here
fsck checks filesystem integrity, not for swap.
- ✓
mkswap /dev/sdb2
Why this is correct
mkswap sets up a Linux swap area.
- ✗
swapon /dev/sdb2
Why it's wrong here
swapon activates swap, but the partition must first be initialized with mkswap.
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 527-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-1 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-1 exam.