EX200 Create and configure file systems Practice Question
A system administrator needs to create a new ext4 filesystem on /dev/sdb1 and mount it persistently at /data. Which set of commands should be used?
⚠ Common exam trap
The trap here is that candidates often forget to create the mount point directory or attempt to use `blkid` output directly in fstab, assuming it will work, when in fact the fstab file requires a specific columnar format with the device, mount point, filesystem type, options, dump, and pass fields.
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
✓
mkfs -t ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab
It creates the ext4 filesystem with `mkfs -t ext4 /dev/sdb1`, creates the mount point directory with `mkdir /data`, mounts the filesystem immediately with `mount /dev/sdb1 /data`, and then adds an entry to `/etc/fstab` using the correct format (device, mount point, filesystem type, options, dump, pass) to ensure the mount persists across reboots. The `&&` operator ensures each command only runs if the previous one succeeds, which is a safe practice for scripting this task.
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 -t ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab
Why this is correct
This is the only complete sequence: mkfs -t ext4 /dev/sdb1 (equivalent to mkfs.ext4) creates a fresh ext4 filesystem, mkdir /data provides the required directory mount point, mount /dev/sdb1 /data attaches the filesystem for immediate use, and appending a correctly formatted fstab line ('/dev/sdb1 /data ext4 defaults 0 0') ensures the filesystem is mounted automatically at boot. The fstab line contains the six required fields in the correct order, making this the correct answer.
- ✗
mkfs.ext4 /dev/sdb1 && mount /dev/sdb1 /data
Why it's wrong here
The command creates the ext4 filesystem but then attempts to mount it to /data without first creating that directory — mount(8) will fail with 'mount point /data does not exist'. Even if the directory existed, this sequence omits the /etc/fstab entry entirely, so the filesystem would not be mounted after a reboot. Persistence requires an fstab record, not just an immediate mount.
- ✗
mkfs -t ext4 /dev/sdb1 && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab && mount /data
Why it's wrong here
This sequence writes the fstab entry before verifying that the mount point exists and then issues mount /data with no device argument, which relies on fstab lookup but fails because /data is absent. Creating a filesystem and adding an fstab line for a nonexistent directory is invalid; the mount attempt would report that /data does not exist. The missing mkdir prevents both the immediate mount and any future boot-time mount from succeeding.
- ✗
mkfs.ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && blkid /dev/sdb1 >> /etc/fstab
Why it's wrong here
Running blkid /dev/sdb1 outputs key=value data such as /dev/sdb1: UUID="..." TYPE="ext4", which is not a valid /etc/fstab line — fstab requires whitespace-separated fields: device (or UUID=), mount point, filesystem type, options, dump, and pass. Appending this raw output corrupts fstab and would cause mount -a to fail with a parsing error. The correct way to reference a filesystem by UUID in fstab is a line like UUID=... /data ext4 defaults 0 0.
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.