Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am getting following disk error on one of my server

smartd[4235]: Device: /dev/sda, 1 Currently unreadable (pending) sectors

Can i apply following command to repair bad block on live RHEL5 system .

badblocks -n -v /dev/hda1
share|improve this question

1 Answer 1

No. badblocks only SEARCHES for bad blocks on drive. it does not repairs them. for repair, you can use following commands:

badblocks /dev/sda1 > badblocks_list

fsck -t ext3 -l badblocks_list /dev/sda1

the first command saves the list of bad blocks in a file,which is feeded to fsck to repair.

share|improve this answer

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.