Courseiva
Storage Management →easyMultiple Choice

LFCS Storage Management Practice Question

A junior administrator has a USB flash drive at /dev/sdb that will be used exclusively as a data disk on a Linux server. They need to create an XFS filesystem on the whole device (no partitions). Which command accomplishes this?

⚠ Common exam trap

The trap here is assuming that a filesystem must always be created on a partition rather than directly on a whole block device.

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 whole block device is done with the mkfs.xfs command followed by the device path. XFS is commonly used for data volumes and supports being placed directly on an unpartitioned disk. The other commands either grow or repair an existing XFS filesystem and cannot initialize a new one.

Answer analysis

Option-by-option breakdown

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

  • ✗

    xfs_growfs /dev/sdb

    Why it's wrong here

    xfs_growfs is used to expand the size of an existing mounted XFS filesystem, not to create one. Running it against /dev/sdb before an XFS filesystem exists would fail because there is no valid XFS superblock to grow. It is the wrong tool for initial filesystem creation on a new device.

  • ✗

    mkfs -t xfs -c /dev/sdb

    Why it's wrong here

    The -c flag for mkfs.xfs performs a read-only check for bad blocks and is not required to create a filesystem. More importantly, mkfs -t xfs does invoke mkfs.xfs, but the -c option does not create the filesystem in this context and can cause confusion. The simplest correct invocation is mkfs.xfs /dev/sdb.

  • ✗

    xfs_repair /dev/sdb

    Why it's wrong here

    xfs_repair is a repair utility for existing XFS filesystems that have become corrupted. It does not format or create a filesystem. Running it on a blank device would fail because there is no XFS metadata to repair, and it would not prepare the USB drive for use.

  • ✓

    mkfs.xfs /dev/sdb

    Why this is correct

    mkfs.xfs is the correct tool to create an XFS filesystem, and it accepts a whole block device such as /dev/sdb as its target. XFS supports being created directly on an unpartitioned device, which is valid for dedicated data disks. This command writes the XFS superblock and metadata to /dev/sdb, making it immediately mountable.

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 →

How Courseiva writes practice questions · Editorial policy

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.