Super User is a question and answer site for computer enthusiasts and power users. 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

I was reading an old sysadmin manual and it said to use the badblocks program to feed e2fsck with the -l parameter the bad cylinders, but newer "guides" are saying to use the -c switch instead.

I am unsure and cannot piece together the man pages or guides, an example situation:

What if I were diagnose that a server had a faulty filesystem (corrupted, or had bad blocks), how would I properly run the program (assuming an ext2/3 filesystem) in a way that will do as described?

How can I unmount the partition and run the check, if the e2fsck program is on that partition? I clearly do not understand the process in this.

I hope I am clear in what I am intending to do.

share|improve this question
up vote 0 down vote accepted

You'll have to double check the e2fsck(8) manual page on that specific system to determine if your version is that old. On modern systems, you definitely want e2fsck -c for a bad blocks check.

If you're running an awesome system such as Debian or Ubuntu, you should have e2fsck-static installed -- and bash-static, as a bonus -- so you can just easily copy the binary to a safe partition and run it from there.

Since you'd be doing this on a presumably live server, and not scrambling to find yesterday's backups to restore onto a new, safe hard drive, I'll assume you just don't have backups and would advise you to boot a recovery live CD such as Finnix, and image/copy your data out sooner rather than later, and then run any diagnostics.

share|improve this answer
Thank you for these alternate options, that really is a lot better than just the two ways I had. Accepted :) – Don Njero. Jan 26 '11 at 6:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .