SD cards and portable storage is getting increasigly large. So before you dump gigabytes of data onto these chips, it’s a good idea to check if the SD card, SDHC, CF-Card or USB Stick is actually in good shape by thoroughly testing the preformated media.
On Windows, there are some nifty focused utils to do just this, like h2test. As Linux comes packaged with many disk testing utilities and the average Linux user is quite aware of them, you won’t get any specific advice on how to check removable media.
My advice to to test removable media, mostly formatted in MS-DOS legacy filesystems like FAT32 or FAT is to use dosfsck, which comes with most debian based *nix systems:
> dosfsck -va /dev/<device path> (verbose mode; automatically repair the file system)
> dosfsck -vtr /dev/<device path> (verbose mode; interactively repair the file system; test for bad clusters)