HowTo Repair Broken ext4 Partitions

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**

7 responses to “HowTo Repair Broken ext4 Partitions

  1. Thanks.. I was looking for this.. btw.. which filesystem do you suggest for my external Seagate GoFlex 1 TB (3.5″, 7200 rpm)? Currently I’m using ext4 with my Arch Linux installation..

  2. Pingback: Repairing a corrupt hard disk

  3. Pingback: Snackycracky Blog

  4. Pingback: Repair ext4 filesystem on Raspberry Pi | Antoine Aflalo: Dev's Blog

  5. Thanks! “fsck.ext4 -cDfty -C 0” realy had the job done! Compared to “fsck -f” that shown nothing. I had my root partition mounting in read-only due to “journal aborted” error. Now it boots with no error.

Leave a comment