A simple test program for flash drives.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE.txt
Makefile
README.md
main.c

README.md

flashtest

A flash drive integrity test program for Linux.

What it does

USB mass storage devices can report arbitrary storage capacities that don't necessarily reflect how much data they can actually store. You can probably buy suspiciously cheap 128G flash drives on eBay right now that will lie about how much space they have and simply throw data away when their real storage space is exhausted.

This program uses C's random number generator to fill a flash drive with a stream of bytes. The data is then read back and compared to the same random stream of bytes. This verifies that the flash drive is correctly storing all of the data you write to it.

Requirements

I wrote and tested this program with GCC 6.3, GNU make 4.2, and readline 7.0. It might work with older versions too. No promises.

Installation & Usage

Clone this repository and run make in it to compile the program. Then, run ./flashtest DEVICE. Replace DEVICE with the block device of your flash drive. You can get a list of block devices by running lsblk. Depending on the size of your drive, flashtest will take some time, so you might want to consider making some tea.

License

This program is licensed under the terms of the simplified BSD license, see LICENSE.txt.