Filesystem Corruption Recovery
Repair an ext4 filesystem that mounted read-only after a power loss.
A advanced Linux challenge worth 20 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
After a hard power loss, /data mounts read-only. The database on /data cannot start. The lab provides a simulated corrupted filesystem image at /tmp/corrupt.img.
Your tasks:
- Confirm the image is corrupt: fsck.ext4 -n /tmp/corrupt.img 2>&1 | head -10
- Run actual repair: fsck.ext4 -y /tmp/corrupt.img
- Mount the repaired image: mount -o loop /tmp/corrupt.img /data 2>/dev/null
or: losetup /dev/loop0 /tmp/corrupt.img && mount /dev/loop0 /data
- Verify read-write: touch /data/fsck_test 2>/dev/null && echo "mounted rw" || echo "mount skipped"
- Write fsck exit code and a one-line summary to /tmp/fsck_report.txt
- Run check to validate