Courseiva

EX200 Extended attributes Practice Question

A system administrator needs to create a file system on /dev/sdb1 with a size of 10 GB and mount it persistently at /data. The file system should support extended attributes and be suitable for large files. Which command sequence achieves this?

⚠ Common exam trap

Red Hat often tests the requirement to mount the file system immediately after creation, not just add it to fstab, and the specific file system type (XFS vs. ext4) based on suitability for large files and extended attributes.

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.xfs /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data xfs defaults 0 0' >> /etc/fstab

Both XFS and ext4 support extended attributes by default in RHEL. However, XFS is optimized for large files and high performance, making it the recommended choice for this scenario. Option B correctly creates an XFS file system on /dev/sdb1, creates the mount point, mounts it immediately, and adds an fstab entry for persistence. Option C uses ext4, which is not as suitable for large files as XFS. Options A and D are incorrect due to wrong device or file system type.

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.xfs /dev/sda1 && mkdir /data && echo '/dev/sda1 /data xfs defaults 0 0' >> /etc/fstab

    Why it's wrong here

    This command formats /dev/sda1, but the intended device is /dev/sdb1; writing a filesystem to /dev/sda1 could destroy the operating system or an existing data partition. Even if the device were correct, the filesystem is never mounted, so /data would remain an empty directory until a reboot or a manual mount command is issued, making the fstab entry insufficient for immediate use.

  • ✓

    mkfs.xfs /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data xfs defaults 0 0' >> /etc/fstab

    Why this is correct

    This is the correct sequence because it creates an XFS filesystem on the intended /dev/sdb1, creates the /data mount point, immediately mounts the device with the mount command, and appends a persistent fstab entry using the xfs type. The && chain stops if any step fails, preventing a broken configuration. XFS is the default and supported filesystem for RHEL/CentOS 8+ and supports extended attributes.

  • ✗

    mkfs.ext4 /dev/sdb1 && mkdir /data && mount /dev/sdb1 /data && echo '/dev/sdb1 /data ext4 defaults 0 0' >> /etc/fstab

    Why it's wrong here

    This command uses ext4 instead of the required XFS filesystem type, so it fails the task specification even though it mounts correctly. Additionally, the fstab entry uses the defaults option, which does not enable user extended attributes; ext4 requires a separate user_xattr mount option to support user xattrs, so the resulting configuration may not meet applications that depend on extended attributes. Thus it is incorrect for this scenario.

  • ✗

    mkswap /dev/sdb1 && mkdir /data && swapon /dev/sdb1 && echo '/dev/sdb1 /data swap defaults 0 0' >> /etc/fstab

    Why it's wrong here

    This command mistakenly treats /dev/sdb1 as a swap device, but swap is not a filesystem for holding data and cannot be mounted to a /data directory. The fstab line is also invalid because a swap entry uses the swap type with a mount point of none or swap, not a directory, and swap is activated with swapon, not mount. Therefore this option is fundamentally wrong.

About these practice questions

Courseiva writes every EX200 question from scratch — 427 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.