0

Here is the output of badblocks -sv /dev/sda

Checking blocks 0 to 488386583
Checking for bad blocks (read-only test): 190698244one, 31:24 elapsed. (0/0/0 errors)
190698245one, 31:29 elapsed. (1/0/0 errors)
190698246one, 31:33 elapsed. (2/0/0 errors)
190698247one, 31:37 elapsed. (3/0/0 errors)
done                                                 
Pass completed, 4 bad blocks found. (4/0/0 errors)

What should I do ?

Rajeev Singh
  • 133
  • 6
  • 1
    There is no way to repair bad blocks. – Panther Apr 21 '16 at 21:09
  • http://www.howtogeek.com/173463/bad-sectors-explained-why-hard-drives-get-bad-sectors-and-what-you-can-do-about-it/ – Panther Apr 21 '16 at 21:11
  • Four blocks bad out of 488386583 blocks is nothing. Also, you cannot repair bad blocks. What makes you think your drive is 'corrupted'? Only four bad blocks is nothing. – Thomas Ward Apr 21 '16 at 21:11
  • @bodhi.zazen, that's not actually true. Even if they are physically bad, drives will remap the logical sector to another one from their spare pool if you write to them, and often times, they aren't physically bad, just corrupt for some reason, such as power failure during write. – psusi Apr 21 '16 at 23:03

1 Answers1

1

You should also check the SMART attributes of the drive either with the Disks utility, or with smartctl on the command line. Since badblocks has identified the bad blocks it found, you can now attempt to repair them by writing zeros to them:

sudo dd if=/dev/sda of=/dev/null bs=1024 count=1 skip=190698244

If that returns an error, then you got the numbers right, and confirmed the sector can not be read. Now try to write zeros to it and the drive will try to repair it:

sudo dd if=/dev/zero of=/dev/sda bs=1024 count=1 seek=190698244

Notice the difference between the two commands, especially seek instead of skip. Make sure you type it correctly or bad things will happen. After doing this, repeat the first command to read-test the sector again and this time it should not fail. Also check the SMART stats on the drive. The important numbers to look at are the counts of pending, reallocated, and offline sectors. If there was nothing physically wrong with the disk, the count of pending sectors should go down, and there should still be zero reallocated or offline sectors. If the count of reallocated sectors goes up, then the drive switched to using a spare sector for that block instead of the damaged area. If there are more than a handful of these, or any offline sectors, you should replace the drive.

psusi
  • 37,551