badblocks is a Linux utility to check for bad sectors on a disk drive.
It can create a text file with a list of these sectors that can be used with other programs, like mkfs, so that they are not used in the future and thus do not cause data corruption.
[2] When run as a standalone program, badblocks gives a list of blocks with problems, if any.
It displays progress by writing out the block numbers as they are checked (-s = show, -v = verbose).
Modern disk drives will probably not show any defective sectors because they silently remap bad sectors to spare tracks,[5] but running the program with a new drive for several days will test the whole surface, and when reading it afterwards S.M.A.R.T.