F3 (Fight Flash Fraud or Fight Fake Flash) tests the full capacity of a flash card (flash drive, flash disk, pendrive).
F3 writes to the card and then checks if can read it. It will assure you have not been bought a card with a smaller capacity than stated. Note that the main goal of F3 is not to fix your removable media. However, there are resources to mark the invalid areas.
This package provides these executables: f3write, f3read, f3brew, f3fix and f3probe.