Quick NVMe performance testing with fio

I've recently been debugging some NVMe / PCIe bus errors on a Raspberry Pi, and I wanted a quick way to test NVMe devices without needing to create a filesystem and use a tool like iozone. I don't care about benchmarks, I just want to quickly push the drive and read and write some data to it.

fio is the tool for the job, and after a quick install sudo apt install -y fio, I create a configuration file named nvme-read.fio:


Then run it with:

sudo fio nvme-read.fio

Easy way to put some stress on the drive, and test your PCIe setup and the drive itself.


You should write data first. For most drives, when you attempt a read on an LBA that has never been written it will automatically send zeros back instead of doing a NAND read which is effectively a controller/FTL test instead of a drive test.

Since Jeff mentioned him 'debugging some NVMe / PCIe bus errors' the type of data passing the bus is not of any interested to him. Though a test pattern that involves only reads (just like hdparm would've done it in the past) ignores the fact that there are PCIe TX and RX data lines.

Contact issues with some pins inside a connector might not get detected by such a mostly unidirectional test as such I second the suggestion to do some writes too :)

This particular test is just to hit the drive and make sure the bus is working at all—it was easy to identify weird issues with ASPM running this test with various configurations.