LFCS Storage Management Practice Question
A junior administrator has installed a new 4 TB SATA disk as /dev/sdb on a RHEL 9 server and wants to use it as a single XFS filesystem mounted at /data. The disk currently has no partition table. Which command should be run first to create an XFS filesystem directly on the whole device?
⚠ Common exam trap
The trap here is assuming that a partition must always be created before formatting, which leads to choosing a command that targets a nonexistent /dev/sdb1.
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/sdb
Creating an XFS filesystem on a raw block device is done with mkfs.xfs followed by the device path. Because the new 4 TB disk has no partition table and the requirement is a single filesystem spanning the entire device, targeting /dev/sdb directly is correct. Partitioning is optional when the whole disk is dedicated to one filesystem.
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 xfs /dev/sdb1
Why it's wrong here
This invokes mkfs with the xfs type but targets /dev/sdb1, which does not exist because no partition table or partition has been created on the new disk. The command would fail with a 'no such file or directory' error. Even if the syntax is valid, the target device is wrong for the stated scenario.
- ✗
xfs_growfs /dev/sdb
Why it's wrong here
xfs_growfs is used to expand an already-mounted XFS filesystem, typically after the underlying block device has grown. It cannot create a filesystem from scratch and requires a mount point, not a raw device, as its argument. Running it on an unformatted /dev/sdb would produce an error about the device not being mounted.
- ✗
fdisk /dev/sdb && mkfs.xfs /dev/sdb
Why it's wrong here
Running fdisk interactively does not create a partition by itself; you would still have to issue commands such as n and w inside the tool. Then mkfs.xfs /dev/sdb would format the whole disk, not the partition, which is inconsistent with having just created a partition table. The chained command is misleading and unnecessary for the stated goal.
- ✓
mkfs.xfs /dev/sdb
Why this is correct
mkfs.xfs creates an XFS filesystem directly on the named block device, so running it against /dev/sdb formats the entire raw disk without requiring a partition table. This matches the requirement of one XFS filesystem on the whole 4 TB disk. Note that mkfs.xfs refuses to overwrite an existing filesystem unless -f is supplied, but here the disk is empty.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 406 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 →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.