After a sudden power loss, a Linux server can no longer mount the /dev/sdb1 partition, which is formatted as ext4. The mount command returns the message "wrong fs type, bad option, bad superblock on /dev/sdb1", and dmesg shows "EXT4-fs (sdb1): bad magic number in super-block while trying to open /dev/sdb1". You have booted from rescue media and verified that the disk is healthy. Which command is the MOST appropriate first attempt to restore the filesystem and preserve the existing data?
The error indicates that the primary superblock is corrupted. ext4 maintains multiple backup superblocks; the first backup on a filesystem that uses 4 KiB blocks is typically at block 32768. Running fsck.ext4 (or its link e2fsck) with the -b option tells the utility to use that backup superblock to repair the primary one. This has a high chance of recovering the filesystem without data loss. Re-creating the filesystem with mkfs.ext4 would erase all data, tune2fs only changes filesystem features and cannot repair a damaged superblock, and resize2fs requires an intact filesystem before it can resize anything.
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 a superblock in the ext4 filesystem?
Open an interactive chat with Bash
How does the `fsck.ext4` utility repair a corrupted filesystem?
Open an interactive chat with Bash
Why is re-creating the filesystem with `mkfs.ext4` not advisable in this scenario?
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