# FlashTester > FlashTester tests USB sticks, SD cards and other disks for fake capacity, data loss and speed. It is free and open source (MIT): one executable for Windows, Linux or FreeBSD, with a GUI and a command line. It runs the same fill-and-verify test as h2testw and f3, and adds a quick capacity probe, whole-disk tests, drive identification, backups and saved reports. The command line suits scripts and AI agents. Commands ask no questions, `--json` puts the result on stdout, the exit code repeats the verdict, and the disk the system runs from cannot be written to. ## Install There is no installer and nothing else to install. Download one file and run it. These links always give the latest release: - Windows 10 / 11, x64: https://github.com/Dissimilis/FlashTester/releases/latest/download/flashtester.exe - Linux x86_64, static: https://github.com/Dissimilis/FlashTester/releases/latest/download/flashtester-linux-x86_64 - Linux aarch64, static: https://github.com/Dissimilis/FlashTester/releases/latest/download/flashtester-linux-aarch64 - FreeBSD 13.5 to 16.0, amd64, static: https://github.com/Dissimilis/FlashTester/releases/latest/download/flashtester-freebsd-x86_64 - Haiku x86_64, experimental, command line only: https://github.com/Dissimilis/FlashTester/releases/latest/download/flashtester-haiku-x86_64 - SHA-256 checksums: https://github.com/Dissimilis/FlashTester/releases/latest/download/SHA256SUMS ```sh curl -LO https://github.com/Dissimilis/FlashTester/releases/latest/download/flashtester-linux-x86_64 chmod +x flashtester-linux-x86_64 ./flashtester-linux-x86_64 list --json ``` Started without arguments it opens the GUI. With any argument it runs on the command line. The examples below call it `flashtester`; use the name of the file you downloaded. ## Naming the target - A volume (file mode, test files go into free space): a drive letter on Windows (`E:`), a mount point on Linux and FreeBSD (`/media/you/STICK`). - A whole disk (raw mode): `--disk` with the id that `flashtester list` prints. That is a number on Windows (`--disk 3`), a kernel name on Linux (`--disk sdb`) and a device name on FreeBSD (`--disk da0`). Whole-disk commands, SMART and the free-space probe need an administrator terminal or root. File-mode tests run as a normal user. On Linux and FreeBSD, unmount the disk before a whole-disk write. ## Commands ```text flashtester list # disks, volumes, what may be tested flashtester info --disk 3 # model, serial, USB IDs, link speed flashtester smart --disk 3 # SMART counters as the drive reports them flashtester test E: # fill free space, read it all back (like h2testw) flashtester test E: --size 8G --cleanup # partial check, delete the test files afterwards flashtester verify E: # re-read data from an earlier test; --h2w for h2testw files flashtester clean E: # delete FlashTester's test files flashtester probe --disk 3 --destroy # real capacity in minutes; erases the disk flashtester diagnose --disk 3 --destroy # 3 to 15 minutes: capacity samples, write cache, speed; erases the disk flashtester test --disk 3 --destroy # full test of every sector; erases the disk flashtester scan --disk 3 # read-only scan for unreadable areas flashtester bench --disk 3 --size 256MiB # read speed, nothing written flashtester bench E: --size 1G # write and read speed in a test file flashtester iops E: # random 4K at queue depth 1 and 32 flashtester fix --disk 3 --destroy # probe, then partition and format to the real capacity flashtester backup E:\photos --output C:\Backups\photos.zip flashtester backup --disk 3 --output C:\Backups\drive.img flashtester --help # every command and option ``` Which command to pick: - "Is this drive fake?" on an empty drive: `probe --disk N --destroy` answers in minutes. It samples positions, so follow it with a full test when every byte matters. - The drive holds files that must stay: `test ` uses free space only. On a fake drive those writes can land on existing files, so back the drive up first. - A quick look at capacity, cache and speed together: `diagnose --disk N --destroy`. - No writing allowed: `info`, `smart`, `scan` and `bench --disk N`. Reading cannot prove capacity. A full test writes every tested byte once and reads it once. A 128 GB stick at 44 MB/s write and 131 MB/s read took about 64 minutes, so run long tests in the background or with a long timeout, or limit them with `--size`. `test` keeps its test files so `verify` can re-read them later. Add `--cleanup` or run `clean` to remove them. ## Output for programs Options that work with every command: - `--json`: the result as one JSON document on stdout. Progress goes to stderr. - `-q`: no progress output. - `--report file.json` or `--report file.html`: save the result. - `--evidence file.html`: a one-page summary for a refund claim. - `--hide-serial`: leave serial numbers out of everything printed or saved. In the JSON result, read `verdict.status`: `ok`, `fake`, `defective`, `read-only`, `unreliable`, `info`, `refused`, `error` or `cancelled`. `verdict.headline` is one plain sentence and `verdict.details` lists the findings. `tested` is the number of bytes covered and `target.claimed` the capacity the drive reports. Sizes are bytes. `flashtester list --json` prints an array of disks. Each has `id` (the value for `--disk`), `size`, `bus`, `product`, `removable`, `volumes` and `protected`. `protected` is `null` when the disk may be tested, otherwise the reason it is locked. ```sh flashtester list --json | jq -r '.[] | select(.protected == null) | "\(.id)\t\(.size)\t\(.product)"' sudo flashtester probe --disk sdb --destroy --json -q > result.json; echo "exit $?" jq -r '.verdict.status, .verdict.headline' result.json ``` ## Exit codes - 0: OK, or an informational command finished - 1: problem found (fake, defective, read-only or unreliable drive) - 2: refused (protected disk, missing `--destroy`, not administrator, bad target) - 3: error - 130: cancelled ## Safety rules for agents - Disks the running system uses are refused for every write, and there is no flag to override that. If the system disk cannot be identified, all writes are refused. - A whole-disk write erases everything on that disk and needs `--destroy`. Without the flag the command exits with 2 and writes nothing. - Before adding `--destroy`, show the user the `list` output and have them confirm the disk by id, size and name. Disk ids can change when drives are plugged in or removed, so run `list` again right before the destructive command. - `plug-pull` and `test --replug` wait for a person to unplug the drive. Do not run them unattended. - An `ok` verdict means the tested data came back intact. It does not predict how long the drive will last. FlashTester never reports a health percentage. ## Links - [Website with downloads and screenshots](https://flashtester.eu/) - [Source code and full command reference](https://github.com/Dissimilis/FlashTester) - [Releases and checksums](https://github.com/Dissimilis/FlashTester/releases) - [Report an issue](https://github.com/Dissimilis/FlashTester/issues)