Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

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.