The logical volume /dev/sdb1, which contains /var/lib, is now mounted read-only. SMART tests report no hardware problems.
Which action should you take first to correct the data-corruption issue and return the server to normal operation with minimal additional risk to the data?
Remount the partition with mount -o rw,discard /dev/sdb1 so that the ext4 journal can finish replaying.
Run smartctl -t long /dev/sdb1 and, if the disk passes, continue normal multi-user operation without further action.
Boot into single-user or rescue mode and run fsck.ext4 -f /dev/sdb1, allowing it to repair any inconsistencies it finds.
Overwrite the first 100 MB of the partition with dd if=/dev/zero of=/dev/sdb1 bs=1M count=100 and then recreate the filesystem.
The filesystem was switched to read-only because the ext4 driver detected metadata corruption. The safest way to repair that corruption is to unmount (or boot into single-user/rescue mode so it is not in use) and run fsck.ext4. The tool replays the journal (if clean) and then performs a full consistency check, fixing directory, inode, or bitmap problems that triggered the error. Overwriting blocks with dd would destroy data, merely remounting read-write can make the damage worse, and running a long SMART test is useful for hardware diagnostics but does not repair logical filesystem errors.
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 fsck and why is it useful in this situation?
Open an interactive chat with Bash
Why does the ext4 filesystem remount as read-only when an error is detected?
Open an interactive chat with Bash
What is the purpose of the ext4 journal, and how does it relate to this problem?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Troubleshooting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access