Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I perform a filesystem check on ext3 partition on linux?
I am looking for a solution that check every file on the filesystem that is it accessible.

UPDATE: I would run it on a server without unmounting the drive.

share|improve this question

You cannot run fsck from within a desktop session. A desktop session requires run-level 2.

sudo init 1

Then unmount everything:

sudo umount -a

Then you can run fsck. Run fsck with the -c option, and it will scan for bad block on the drive. Then, afterwards, you can run:

sudo init 2
share|improve this answer

Regarding your update, see Why can't you fsck a mounted partition?

As for checking everything, fsck -n will safely look at any filesystem, online or offline, and report results. The -n flag keeps it from changing anything. If you run fsck against a mounted partition without that flag, game over dude.. Those results will be slightly nutters and may tell you all sorts of bad things are happening to your online file systems when they're just fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.