1

Possible Duplicate:
External Hard Drive bad sectors recover/mark utility in linux

I suspect my laptop's harddisk has a bad sector. Could anyone tell me what is the most reliable way to fix the harddisk?

I am using badblocks but as I understood from the man page, it only points the bad sectors, after that how do I suppose to fix the bad sector?

  • 1
    Defective hard drives aren't fixable. If your drive's developing bad blocks, try to back it up and replace it. – Mat Oct 20 '12 at 09:06

1 Answers1

0

If you only have one bad sector, you can force the drive's controller to remap it to a spare sector. Do so by manually trying to read it and write it back again.

Useful tools are badblocks or smartctl for identifying and dd or hdparm --write-sector.

glglgl
  • 1,449
  • 11
  • 23
  • I am using "badblocks -nvm /dev/sda" which has been performing 17 hours already and completed only 15%. Would you recommend me to do low level formatting as it is explained here http://www.dedoimedo.com/computers/low-level-formatting.html? –  Oct 20 '12 at 09:21
  • @johan If you have a safe backup (better: more), you can try to "reformat" your disk (I put it in quotes because it is not a formatting in the original sense of the word). Here every bad block should be replaced with a spare one. Are you getting any output from y our currently running `badblocks` process? – glglgl Oct 20 '12 at 09:28
  • I get the following output: Checking for bad blocks in non-destructive read-write mode From block 0 to 312571223 Checking for bad blocks (non-destructive read-write test) Testing with random pattern: 11.50% done, 16:30:38 elapsed. (0/0/0 errors). I have not got any error yet. I format my laptop by a recover disk but I did not solve the problem. I guess it just loaded windows 7 image. Do you think it would help to follow the instruction above to perform low level formatting? –  Oct 20 '12 at 09:48
  • Nowadays, low level formatting doesn't do anything beyond writing to disk and, if needed, remapping. So I don't think it gets you any more benefit. – glglgl Oct 24 '12 at 11:35