Over time I gathered a bunch of USB sticks I wanted to verify if they are still good and usable. For such a task I found the tools f3probe and fio. So, I installed both on a Linux based PC (I used a Gentoo based one, but WSL based should also do).

I prepared a small script to always get the same tests for the USB sticks:

#!/bin/bash
fileToTest="/dev/sdd"

################################################################################
# check validity
f3probe --destructive --time-ops "$fileToTest" 2>&1 > f3.log

################################################################################
# generate io performance data
fio --output=fioJobs.log       --filename="$fileToTest" fioJobs

The fileToTest specifies the device which should be tested. And as always in Linux: “Everything is a file” 😊 Important: this test completely overrides critical data on the USB stick, so ensure that it is empty, and you have a backup of important data before doing the test!

And used it with the config file to get values for IOPS, throughput, latency, etc.

[global]

[iopsWrite]
rw=randwrite
name=IOPS-write
bs=4k
direct=1
numjobs=4
ioengine=libaio
iodepth=32
refill_buffers
group_reporting
runtime=60
time_based
stonewall

[iopsRead]
rw=randread
name=IOPS-read
bs=4k
direct=1
numjobs=4
ioengine=libaio
iodepth=32
refill_buffers
group_reporting
runtime=60
time_based
stonewall



[latWrite]
rw=randwrite
name=latency-write
bs=4k
direct=1
numjobs=4
ioengine=libaio
iodepth=1
refill_buffers
group_reporting
runtime=60
time_based
stonewall

[latRead]
rw=randread
name=latency-read
bs=4k
direct=1
numjobs=4
ioengine=libaio
iodepth=1
refill_buffers
group_reporting
runtime=60
time_based
stonewall



[thruWrite]
rw=randwrite
name=throughput-write
bs=1024k
direct=1
numjobs=4
ioengine=libaio
iodepth=32
refill_buffers
group_reporting
runtime=60
time_based
stonewall

[thruRead]
rw=randread
name=throughput-read
bs=1024k
direct=1
numjobs=4
ioengine=libaio
iodepth=32
refill_buffers
group_reporting
runtime=60
time_based
stonewall

I was lucky and only one, very old USB stick was not usable any more 😊