Ubuntu – HD bad blocks: is there a way to repair them


During the last month Ubuntu starts having some problems: it shuts down suddenly without any apparent reason.. I figured out that the problem is in the hard disk, if I run this command:

$ sudo badblocks -sv -b 512 /dev/sda

I get 24 bad blocks all in the Linux partition (I have Windows in another one and it does not have the same problem). The question is if there is a way (different from changing the disk) for avoiding this shutting down. Maybe isolating the bad blocks?

Best Answer

If a disk has bad sectors (that is what bad blocks detects) then it will still work. Hard disks have extra sectors on them that are automatically remapped so the disk will continue to work.

In Ubuntu you can use Disks (in older versions is was call Disk Utility) to check on the SMART status of the disk. It can give predictive failure information.

Using a utility like SpinRite you can check the disk and definitely find out if they are bad or not. If run at the highest level it will check every sector and reinstate any sectors that are marked bad when they are actually okay, and mark any that should be bad.

If the disk is on the way out I would replace it rather than take any chances.

Related Question