Linux check USB stick or errors Open the terminal application. Insert your USB stick or pen drive into Linux system. To test and detect bad sector in USB flash memory or pen drive, run: badblocks -w -s -o error. log /dev/sdX.