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
link|improve this question

61% accept rate
feedback

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.