How to check for bad sectors /blocks on hard disk

First use the fdisk with superuser privileges to list all your disk drives and partitions

fdisk -l

Example disks:

  • /dev/sda
  • /dev/sdb
  • /dev/sdc

Example partitions:

  • /dev/sda1
  • /dev/sda2
  • /dev/sda3
  • /dev/sdb1
  • /dev/sdb2

Check your partitions by typing:

badblocks -v /dev/your.partition

Example output:

Checking blocks 0 to 1023
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found. (0/0/0 errors)

Or you could sadly get the number of bad sectors 🙁