Posted in Hardware Linux

Checking for bad blocks on your drive

August 15, 2008 - 2 comments

If your partition is /dev/sda1

e2fsck -cc /dev/sda1

From the man pages :

       -c     This  option  causes  e2fsck to use badblocks(8) program to do a
              read-only scan of the device in order to find  any  bad  blocks.
              If  any  bad  blocks  are found, they are added to the bad block
              inode to prevent them from being allocated to a file  or  direc‐
              tory.   If  this  option  is specified twice, then the bad block
              scan will be done using a non-destructive read-write test.

Comments

Vijay Kumar

September 2, 2008 - 12:55

Hi Wains,
Some one told me about your site just a while ago and whild broswsing I got this page http://www.wains.be/index.php/2008/08/15/checking-for-bad-blocks-on-your-drive/ . As an expert you might have forget that poeple needs to be told that we can check all partitions by the command ‘df’. I hope you wont mind that. I want to be your friend and learn some of the things which I may use in future.

Sorry if you feel bad.

Vijay

Sébastien Wains

September 10, 2008 - 20:40

Hi Vijay, thanks for commenting. This post was mainly because I tend to forget some commands more easily than others. As you can notice on the right column, this site is a “personal knowledge base” shared to the world, so some posts can provide “raw” information (some info missing, not esp. well written, etc.), such as the way to find out the partition device in this post. Thanks for making this post complete with your comment.

Feel free to comment again if you find incorrect or missing information.

Regards

Leave Comment

Please consider visiting the partners below if you enjoyed this article :

If this post saved you time and money, please consider checking my Amazon wishlist.

Before submitting, some rules :
- Is your comment related to the article ?
- You're having a problem ? Have you checked Google, other howtos, docs, manpages ?
- You're still having the problem ? Have you raised log verbosity, checked traces, ran tcpdump ?
- Have you checked your configuratoin for typo ?
Unless your comment is providing additional info or respect the rules above, DON'T comment.
If you don't understand what you are doing, I urge you to read the documentation, I'm not your free Level 1 helpdesk guy.