A system administrator has noticed that applications are having trouble accessing configuration files stored on a mounted filesystem. Upon inspection, the system logs indicate read errors on the filesystem in question. The administrator suspects filesystem corruption. Which command should be executed to check and repair the filesystem while it's unmounted, preventing further damage or potential data loss?
The correct command for checking and repairing a corrupted filesystem is fsck. It checks the integrity of the filesystem and repairs any errors found when the filesystem is not mounted, which prevents additional corruption or data loss during the repair process. The command e2fsck is specifically for ext2/ext3/ext4 filesystem types, which might not apply to all filesystems. The mkfs command is used to create a filesystem, not repair it; using it in this scenario would result in data loss. fdisk is used for disk partitioning, which is not applicable to filesystem checks or repairs.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the fsck command in Linux?
Open an interactive chat with Bash
Why should a filesystem be unmounted before running fsck?
Open an interactive chat with Bash
How does e2fsck differ from fsck, and when is it used?