Courseiva
Block Devices, Filesystems and Advanced StoragemediumMultiple ChoiceObjective-mapped

LPIC-2 Practice Question: Block Devices, Filesystems and Advanced Storage

A filesystem check on an XFS filesystem reports corruption. What is the recommended way to repair it?

⚠ Common exam trap

A common mix-up: candidates think `xfs_repair` can be run safely on a mounted filesystem (like `fsck` on ext4 with `-f`), or that `xfs_check` is still a valid repair tool, when in fact XFS requires unmounted repair and the dry-run step is a critical safety measure.

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

Run xfs_repair -n first, then unmount and repair.

The recommended procedure for repairing a corrupted XFS filesystem is to first run `xfs_repair -n` in dry-run mode to assess the damage without making changes, then unmount the filesystem and run `xfs_repair` to perform the actual repair. XFS does not support online repair; the filesystem must be unmounted for write operations to avoid further corruption.

Answer analysis

Option-by-option breakdown

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

  • Run xfs_check on the mounted filesystem.

    Why it's wrong here

    xfs_check is deprecated and also requires unmounted.

  • Run xfs_repair on the unmounted filesystem.

    Why it's wrong here

    While possible, best practice is to run xfs_repair -n first to assess damage.

  • Run xfs_repair -n first, then unmount and repair.

    Why this is correct

    Best practice: run in no modify mode before actual repair.

  • Run fsck -t xfs on the mounted filesystem.

    Why it's wrong here

    xfs_repair requires unmounted filesystem.

About these practice questions

This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.