EX200 Create and configure file systems Practice Question
Which TWO commands are needed to set up a swap partition on /dev/sdd1 for immediate use?
⚠ Common exam trap
Red Hat often tests the distinction between preparing a swap device (`mkswap`) and activating it (`swapon`), and the trap here is that candidates might think `swapon -a` or a single command like `mkfs.swap` is sufficient, when in fact both steps are required and the correct command names are specific.
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
✓
swapon /dev/sdd1
The `swapon /dev/sdd1` command activates the swap partition immediately, making it available for the kernel to use as virtual memory. Option C is correct because `mkswap /dev/sdd1` writes the swap signature (UUID and swap superblock) to the partition, which is a prerequisite for any swap device to be recognized by the kernel. Together, these two commands first prepare the partition as a swap area and then enable it for immediate use.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
swapon /dev/sdd1
Why this is correct
The swapon command activates an existing swap device. After a partition has been prepared with mkswap, it is not automatically enabled; running swapon /dev/sdd1 makes the kernel immediately use that partition as paging space. Without this step, the swap space remains available only as a prepared but inactive signature on disk.
- ✗
parted /dev/sdd mkswap
Why it's wrong here
The parted utility is an interactive or scripted partitioning tool that creates, resizes, and destroys partition tables and partitions. It does not provide a mkswap subcommand or any mechanism to write a swap signature; preparing a swap partition is handled exclusively by the mkswap command. Running 'parted /dev/sdd mkswap' would be rejected as an invalid subcommand, making this option incorrect.
- ✓
mkswap /dev/sdd1
Why this is correct
mkswap is the dedicated utility that initializes a partition for use as swap space by writing the swap signature and version header to the device. This must be applied to the partition itself, e.g., /dev/sdd1, and not to the whole disk, because the system will later enable that specific partition. However, mkswap only prepares the space; it does not activate it.
- ✗
swapon -a
Why it's wrong here
The 'swapon -a' command reads /etc/fstab and activates every swap device listed there. In this scenario /dev/sdd1 has not been added to an /etc/fstab entry, and the partition has not yet been run through mkswap, so the kernel would not recognize it as valid swap even if it were listed. Using swapon -a would either skip the device or fail, but it would not set up and enable a fresh, unconfigured partition.
- ✗
mkfs.swap /dev/sdd1
Why it's wrong here
mkfs.swap is not a real command; the mkfs front-end only creates filesystems for entries like mkfs.ext4, mkfs.xfs, or mkfs.vfat, and there is no swap filesystem among those. Swap space is not a filesystem at all but a raw block area with a specific signature, so the correct preparation tool is mkswap. Thus issuing mkfs.swap /dev/sdd1 would fail with 'command not found'.
Go deeper
Related to this question
About these practice questions
One of 427 original EX200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.