How to repair/isolate hard drive bad blocks
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?
Software/file system bad blocks marking is mostly a thing of the past; recent drives automatically relocate bad blocks in a transparent way.
If you start getting bad blocks "visible" to software it probably means that the hard drive is exhausting the reserve of free replacement blocks, so it's probably failing. You should check the SMART status of the disk to see if this is actually confirmed by the other SMART attributes, do a backup and get ready to replace your drive.
I found a good tutorial that might help you: http://www.ehow.com/how_6864409_fix-bad-sectors-ubuntu.html
Open the terminal > type the command mount
and follow the steps:
Choose a filesystem to repair. For example, you might choose the filesystem named "/home" if the output from the "mount" command includes this line: /dev/mapper/vg0-home on /home type ext3 (rw)
Type the "umount" command to unmount the filesystem. To unmount the "/home" filesystem, for example, issue the command " sudo umount /home
".
Type the "fsck" command to repair the filesystem. The "fsck" command stands for "file system check"; it scans the disk for bad sectors and labels the ones that aren't working. To run fsck on the /home filesystem, issue the command "sudo fsck /dev/mapper/vg0-home". Replace "/dev/mapper/vg0-home" with the output from your "mount" command, as appropriate.
Type the "mount" command to remount the repaired filesystem. If you repaired the "/home" filesystem, then use the command " sudo mount /home
".
Spinrite (grc.com) is the best tool I know of for recovering bad sectors and getting the drive to use backup sectors in their place. Its not cheap but it works. If any of your friends own a copy you are allowed to borrow it. Ive used it for 7 years now. Its good for periodic maintenance too.
链接地址: http://www.djcxy.com/p/18792.html上一篇: 防止重复条目parse.com
下一篇: 如何修复/隔离硬盘坏块