Courseiva
Configure local storageeasyMultiple ChoiceObjective-mapped

EX200 Configure local storage Practice Question

An administrator wants to add an additional swap partition of 2GB on device /dev/sdb1. Which set of commands should be used to enable swap and make it persistent across reboots?

⚠ Common exam trap

Red Hat often tests the distinction between filesystem creation (`mkfs.*`) and swap initialization (`mkswap`), and the trap here is that candidates may confuse `swapon` with a non-existent command like `swapadd` or think `parted` can enable swap directly.

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/sdb1; swapon /dev/sdb1; echo '/dev/sdb1 swap swap defaults 0 0' >> /etc/fstab

It follows the proper sequence to prepare and activate a swap partition on /dev/sdb1. First, `mkswap` initializes the partition as a swap area by writing a swap signature. Then `swapon` activates it immediately. Finally, adding an entry to /etc/fstab ensures the swap is automatically enabled at boot, making it persistent across reboots.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • parted /dev/sdb set 1 swap on

    Why it's wrong here

    The `parted` command can manipulate partition tables and set certain flags, such as `lvm` or `boot`, but `swap` is not a valid partition flag accepted by `parted`. A swap area is defined by the swap signature written by `mkswap`, not by a partitioning flag. Even if `parted` accepted this flag, it would neither initialize nor activate swap, so this option cannot achieve the goal.

  • swapadd /dev/sdb1

    Why it's wrong here

    The `swapadd` command does not exist on Red Hat Enterprise Linux or any standard Linux distribution. Proper swap setup requires `mkswap` to write a swap signature and `swapon` to activate the device. This option is incorrect because it references a nonexistent utility, so it would fail with a command-not-found error.

  • mkswap /dev/sdb1; swapon /dev/sdb1; echo '/dev/sdb1 swap swap defaults 0 0' >> /etc/fstab

    Why this is correct

    This is the correct sequence: `mkswap` initializes the partition with a swap signature, `swapon` activates it immediately for use by the kernel, and appending the line to `/etc/fstab` ensures the swap partition is automatically enabled at boot. The fstab entry uses the correct fields: device, mount point specified as `swap`, filesystem type `swap`, and `defaults` as the mount options. This covers both immediate activation and persistence across reboots, satisfying the administrator's requirement.

  • mkfs.ext4 /dev/sdb1; mount /dev/sdb1 /swap

    Why it's wrong here

    Running `mkfs.ext4` creates an ext4 filesystem on the partition, which is fundamentally different from swap space. Swap does not use a filesystem; it requires a raw swap signature that the kernel recognizes during the `swapon` call. Mounting an ext4 filesystem at `/swap` merely attaches a regular filesystem to that directory, providing no swap functionality and it would never be activated by `swapon -a`.

  • None of the above

    Why it's wrong here

    Selecting "None of the above" falsely implies that no valid answer is provided. In reality, the correct sequence of commands is present among the choices: `mkswap`, `swapon`, and adding an `/etc/fstab` entry constitute the standard, complete method for adding a persistent swap partition. Therefore, this option is factually wrong because it dismisses a valid solution that already exists in the list.

About these practice questions

Courseiva writes every EX200 question from scratch — 127 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.