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 allows checks only 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 does 'fsck' stand for and how does it work?
Open an interactive chat with Bash
Why is it important to unmount a filesystem before running 'fsck'?
Open an interactive chat with Bash
What could cause filesystem corruption, and how can it be prevented?