How to Set Up and Benchmark Your NVMe on the Raspberry Pi 5

Tim Moody
5 min readFeb 11, 2024

--

Pimoroni NVMe Base

We’re saying farewell to slow, small, and unreliable micro sd’s and saying hello to PCIe enabled NVMe storage for our Raspberry Pi 5 setup.

I’m going to compare all the NVMe hats I can get my hands on to find the best one and guide you through setting them up and testing their performance while I’m at it.

For these tests I’ll be using one of the most top of the line NVMes I can find. A Samsung EVO 970 M.2 NVMe.

I wouldn’t suggest getting a drive over 2 TB as it will introduce complications with partitioning. Based on threads I’ve looked at it is possible to do but only after lengthy config changes.

Pimironi NVMe Base

Check for the new NVMe drive

lsblk
1 TB NVME is Found!

Boot from the NVMe Directly

apt-get update
sudo raspi-config

“Advanced Options”

Boot Loader Version

Use the Latest […]

Reboot

sudo reboot now
sudo apt-get update

Update

sudo apt-get upgrade
sudo raspi-config

Advanced Options

Boot Order

Select NVMe

Enabled VNC (Optional)

sudo raspi-config

Interface Options

Enable VNC

Reboot

sudo reboot now

Copy the Operating System to the NVME

Connect over VNC to raspberrypi.local

Accessories

SD Card Copier

Shutdown

sudo shutdown now

Remove the Micro SD Card

Power on the Pi

lsblk

We should now only see the NVMe drives.

Enable PCIe Generation 3 Speeds (1,000 MB/s)

For a quick refresher on the varying throughput capacities across the PCIe generations per lane…

source: curcial.com

According to this the overclocked PCIe to NVME connection should have a theoretical maximum of 1,000MB/sec

For reference the current speeds the new iPhone 15 is clocking in terms of internal storage read/write times have been benchmarked below.

So yes, the Raspberry Pi at PCIe Gen 3 is on par with the iPhone 15 (2024 model).

vim /boot/firmware/config.txt

Append the line

dtparam=pciex1_gen=3

Save and close.

Reboot

sudo reboot now

Check the speeds of the PCIe buses

lspci -vvv

We should see 8GT

Benchmarking Performance

Install HDParm

apt-get install hdparm

Assess Read times of the NVMe

sudo hdparm -t --direct /dev/nvme0n1

If you need to get the location and name of your drive you can use this.

sudo fdisk -l

Review Read time…

Get the Boot Time

systemd-analyze

Run Pi Benchmarks Scipt

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

Download Pi Apps (with GeekBench6)

https://pi-apps.io/

wget -qO- https://raw.githubusercontent.com/Botspot/pi-apps/master/install | bash

Geek Bench

Navigate to Pi Apps then Tools then GeekBench6

Once installed from the terminal run

geekbench6

Pineberry NVMe Hat Drive Bottom

https://pineberrypi.com/products/hatdrive-bottom-2230-2242-2280-for-rpi5

Pineberry NVMe Hat Drive Bottom

The Results

Boot Times

The Raspberry Pi 5 boots in about 10 seconds regardless of the storage partition you’re booting from. But it is considerably faster than legacy hardware.

Read Speeds

The Samsung Evo on either the Pimoroni or Pineberry hat can read over 800 MB/sec which is adequate for almost any needs. The Raspberry Pi 5 using a premium micro SD can do about 85 MB/sec due to it’s upgraded Micro SD slot protocol, it’s twice as fast as the Micro SD slot on the Raspberry Pi 4. But interestingly the ZimaBlade’s PCIe Gen 2 with it’s 4 exposed lanes was able to show read times of over 1200 MB/sec.

Pi Benchmarks Score

https://pibenchmarks.com/

This anlysis is quite involved, doing the following -

  • Executes hdparm to measure the read speed of the drive.
  • Uses dd to test write performance by writing a large file and measuring the time taken.
  • Runs fio for more granular testing, including random read/write performance and IOPS (Input/Output Operations Per Second).
  • Performs tests with iozone to assess file system performance across various operations.

Notably, the NVMe generates a jaw dropping 3,300% improvement over the standard micro sd…

Geek Bench

This test is more focused on the CPUs but interestingly the addition of the NVMe did improve the scores.

Full Video Tutorial

--

--