Posted 24 November 2011 - 01:36 AM
badblocks -s -v -n /dev/sdb1
Assuming that /dev/sdb1 is not mounted, not a swap partition. You don't want to test a mounted or otherwise in-use partition.
The "-s" means to show progress of the test; the "-v" means to be verbose; "-n" means to use a non-destructive (read-only, without writing) test.
Check the man page and it will give you some other options. Be sure NOT to use the "-w" (write data to the drive, or I prefer to consider it the "wipe out") option, nor the "-f" option.
From the man page: "if you think you're smarter than the badblocks program, you almost certainly aren't." (regarding the -f option)