Difficulty: Easy
Correct Answer: fsck
Explanation:
Introduction / Context:
File system integrity is crucial for data reliability. After unexpected power loss or hardware issues, file systems may contain inconsistencies. Linux provides a standard tool to check and, when necessary, repair file systems to a consistent state before mounting them read-write.
Given Data / Assumptions:
Concept / Approach:
fsck is the front-end tool that orchestrates file system checks. It calls the appropriate checker (such as e2fsck for ext2/3/4 or xfs_repair for XFS) based on the device and file system type. It is typically run on unmounted file systems or in single-user/emergency mode to avoid further damage.
Step-by-Step Solution:
Verification / Alternative check:
Review system logs after boot; many distributions run fsck automatically based on mount counts or dirty flags. For ext filesystems, compare results with tune2fs -l to see mount counts and check intervals.
Why Other Options Are Wrong:
Common Pitfalls:
Running fsck on a mounted file system, misunderstanding that some modern file systems have different repair workflows, and ignoring hardware issues causing recurring corruption.
Final Answer:
fsck
Discussion & Comments