badblocks -svn /dev/sda
What does it do? Does it just report the bad blocks? Or does it somehow handle the bad blocks so that I don't need to be worried about them?
I read the manual by
man badblocks, but I don't get the
-s Show the progress of the scan by writing out rough percentage completion of the current badblocks pass over the disk. Note that badblocks may do multiple test passes over the disk, in particular if the -p or -w option is requested by the user. -v Verbose mode. Will write the number of read errors, write errors and data- corruptions to stderr. -n Use non-destructive read-write mode. By default only a non-destructive read- only test is done. This option must not be combined with the -w option, as they are mutually exclusive.
The output of running
badblocks -svn /dev/sda which lasted for almost two days:
Some posts suggest that after running
badblocks -svn /dev/sda, the hard disk controller would take care of bad blocks. Not sure.
to have the hard disk controller replace bad blocks by spare blocks.
If you have fully processed your disk this way, the disk controller should have replaced all bad blocks by working ones and the reallocated count will be increased in the SMART log.
I checked the SMART table after running the
badblocks command by:
smartctl --all /dev/sda
Current_Pending_Sector raw value is
56. It's twice the
28 reported by
badblocks. Maybe they are related.
According to this:
badblocks error log is in the form of
reading/writing/comparing. In my case, all of
28 errors are reading errors. Meaning no application can read those blocks.
I looked at OS logs by
sudo journalctl -xe. Actually, SMART is throwing errors about those
56 bad sectors (
28 bad blocks):
smartd: Device: /dev/sda [SAT], 56 Currently unreadable (pending) sectors
I'd rather backup the data and replace the hard disk before it's too late.