Every now and then, you might run into a situation where your *nix installation won’t start due to a corrupted/damaged journal, be it due to power failure or disk failure.
That’s where fsck comes in handy.
You should boot from live distribution, such as Ubuntu live CD (running fsck on a mounted system is very dangerous), and run fsck on your file system, one partition at a time. Here’s my favourite setting:
fsck.ext4 -cDfty -C 0 /dev/sd**
- -c – check for bad sectors
- -D – optimize directories if possible
- -f – force check, even if filesystem seems clean
- -t – print timing stats (use -tt for more)
- -y – assume answer “yes” to all questions (such as, “do you want to continue”)
- -C 0 – print progress info to stdout
- /dev/sd** – the partition to check, e.g. /dev/sda1 for first partition (1) on first hard disk (a), etc.
For reiser FS you can use the following:
fsck.reiserfs --fix-fixable -y /dev/sd**