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







Vijay Kumar
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