Adding NVME Storage To A Raspberry Pi 5 – Pimorni NVMe Base Installation – Episode 5

1, Dec 2024 | Raspberry Pi 5 Series

Recommended Hardware & Tools

Check out my official Amazon Storefront to browse the exact parts, tools, and gear I use in my tutorials and videos.

As an Amazon Associate I earn from qualifying purchases.

Introduction:

Today, we will be exploring the best NVMe HAT and storage options for the Raspberry Pi 5. After countless hours of testing and research, I’m excited to share my top recommendations with you and guide you through a full installation process.

We will also cover why our chosen NVMe HAT stands out from the rest, how it integrates seamlessly with the Raspberry Pi 5, and the performance benefits it offers over the standard micro SD card.

YouTube Video

We’ll start by discussing the evolution of storage on the Raspberry Pi and the advantages of the new PCIe port on the Pi 5. Then, we’ll move into benchmarking tests to compare boot times, read/write speeds, I/O performance, and power consumption between SD cards and NVMe drives.

I’ll also highlight the different NVMe HATs available, their pros and cons, and walk you through installing the Pimoroni NVMe HAT, which is our top choice.

Finally, I’ll show how to transfer your Raspberry Pi OS to the NVMe and share the results of our comprehensive tests.

If you’re new here, this video/post is part of a dedicated Raspberry Pi 5 series designed for all experience levels.

We've included links to all the recommended products mentioned in this episode, each of which has been thoroughly tested for compatibility with the Raspberry Pi 5. These are affiliate links, meaning they come at no extra cost to you, but they help support us with a small commission. A huge thank you to everyone who uses these links—your support truly makes a difference!

Prerequisites.

If you have been following our Raspberry Pi 5 series, you should already have a clean installation of Raspberry Pi OS Desktop on your SD card and your Raspberry Pi 5 fully connected and ready for its first boot. This guide will start from that setup, so ensure your setup matches or refer to our earlier episode below to get everything in place.

  • A Raspberry Pi 5
  • Keyboard and Mouse & Monitor
  • SD Card with Raspberry Pi OS desktop installed onto it

Now we have all that out the way, let’s get into today’s episode!

SD Card History On The Raspberry Pi.

Before we dive into NVMe storage on the Raspberry Pi 5, let’s look at how storage has evolved across Raspberry Pi models. For years, SD cards were the main storage for Raspberry Pi, offering an affordable and simple solution that was ideal for lightweight applications, education, and hobby projects.

Despite being convenient, SD cards have some major limitations. First, they’re relatively slow, which means longer boot times and slower data access—especially noticeable in tasks involving larger files or complex applications.

SD cards also tend to degrade over time. Their memory cells wear out with frequent read/write cycles, which can lead to data corruption. This is a common problem in setups that run continuously or log data frequently, like IoT devices and media servers. Capacity was another constraint; while larger SD cards are available today, they’re more costly per GB, and still fall short of NVMe’s capabilities.

So, SD cards have been essential but also limiting for Raspberry Pi users.

Introduction to the PCIe Port.

Now that we understand the limitations of SD card storage, let’s talk about one of the most exciting upgrades on the Raspberry Pi 5—the PCIe port. This port introduces a new level of functionality that opens up possibilities beyond what previous Raspberry Pi models could offer.

The addition of a PCIe, or Peripheral Component Interconnect Express, port on the Raspberry Pi 5 is a game-changer for data transfer and storage capabilities. Unlike previous models that relied solely on SD cards, this port enables direct, high-speed connections with devices like NVMe storage. Essentially, PCIe provides a dedicated pathway for data, bypassing the bottlenecks we saw with SD cards and USB storage.

PCIe on the Raspberry Pi 5 runs at PCIe 2.0 x1 speeds, which offers data transfer rates of up to 500 MB/s. While this isn’t as fast as some desktop PCIe connections, it’s a huge leap from the speeds we’re used to with SD cards.

Another major benefit is the flexibility the PCIe port brings. It’s not just for storage; you can connect a variety of compatible devices, from network adapters to additional USB hubs. However, in this episode, we’re focused on the big advantage of using it for NVMe storage to boost both speed and capacity.

In short, the PCIe port on the Raspberry Pi 5 unlocks performance and storage capabilities that we could only dream of on previous models. This upgrade will make the Pi much more versatile, especially in projects where data speed and reliability are key.

Baseline Benchmark Tests (SD Card).

Now, let’s move on to our initial benchmarking tests with the SD card to set a baseline, so we can later see how much the NVMe storage improves performance.

Boot Time Test With system-analyze.

First up, we’ll measure the SD card boot time. We’re going to use the "systemd-analyze" command to check how long the system takes to boot. We will do this straight after a clean boot. This will give us an overview of the total boot time, splitting it into kernel and user-space initialisation.

systemd-analyze

Running this command shows us how quickly the Raspberry Pi 5 is able to get up and running using the Micro SD card.

Read & Write Benchmark Test Using Pibenchmark script.

And finally, we’ll run a comprehensive test using the PiBenchmarks script. This will execute multiple tests, providing a full benchmark overview

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

This script is a great way to round off our benchmark tests and compare our results with others on pibenchmarks.com.

NVMe Hat Options and Comparisons.

Alright, now that we've tested the baseline performance of the SD card, let's dive into one of the most important choices you'll make when upgrading your Raspberry Pi 5: selecting the right NVMe hat. There are a few great options out there, so let's take a look at three popular choices and compare their pros and cons.

But before we get into the specifics, it's important to understand how hat compatibility can affect your Raspberry Pi setup. Some hats can block access to important ports like the GPIO pins or may not fit properly with certain cases. This can limit your ability to expand your Pi's functionality or protect it with a case. So, choosing the right hat is crucial, especially if you plan to use your Pi for additional projects in the future.

Official Raspberry Pi M.2 HAT+.

First up, we have the official Raspberry Pi M.2 HAT+. This hat is designed to provide basic NVMe support and is compatible with 2230 and 2242-sized NVMe drives. It connects directly to the Raspberry Pi 5’s PCIe interface, which runs at PCIe 2.0 speeds, giving it a max transfer rate of 500 MB/s.

In summary, while the official Raspberry Pi M.2 HAT+ does provide some limited GPIO connectivity, it’s not direct access to the full range of GPIO pins on the Raspberry Pi. To fully access the GPIO pins, you would need to add pass-through pins to the HAT+, which may require additional hardware and setup. So if full GPIO access is a priority, this may not be the most convenient option.

Additionally if you were wanting to follow along with our Raspberry Pi 5 series we will be covering projects that will utilize the GPIO pins so you would want to avoid any hats that are blocking them.

Official Pi PCIe to M.2 HAT for Raspberry Pi 5 Recommended

Official Pi PCIe to M.2 HAT for Raspberry Pi 5

Buy from Amazon USA
Buy from Amazon UK

Overall this hat is budget-friendly at just £11.50 ($12-14), making it a great choice for those looking for an affordable NVMe solution. But keep in mind the limitations regarding GPIO access and case compatibility, especially if you plan to expand your Raspberry Pi's capabilities or enclose it in a case.

Pimoroni NVMe HAT.

Next up, we have the Pimoroni NVMe Base, which is compatible with a wider range of NVMe drive sizes, from 2230 up to 2280.

This hat mounts neatly under the Raspberry Pi, making it a great choice if you want a compact setup. One of the best features of the Pimoroni NVMe Base is that it's designed to maintain GPIO access, so you won’t have to sacrifice expansion options for your storage upgrade.

Since the Pimoroni NVMe Base installs underneath the Raspberry Pi 5, it leaves the top of the Pi free, meaning you can add other hats on top if you want to expand your setup even further. This is a major advantage over hats, which mount on top and make additional hat compatibility difficult.

The Pimoroni NVMe Base is an excellent choice for combining flexibility and performance. By preserving GPIO access, it’s ideal for projects involving electronics and interfacing—topics we’ll be exploring in future episodes.

Additionally, Pimoroni has announced that a compatible case for the NVMe hat is in development, though as of this recording, a release date hasn’t been provided. For now, we’ll focus on installing the NVMe drive on a bare Raspberry Pi 5.

Also just to add. The NVMe base follows the new "PIP" design guidelines provided by Raspberry Pi ensuring that it will be easy to use and be supported long term by updates to Raspberry Pi OS.

Buy an Pimoroni NVMe base here (Non affiliate link): https://shop.pimoroni.com/products/nvme-base?variant=41219587178579

GeeekPi NVMe Hat Family and Metal Case.

Finally, there’s the GeeekPi family of NVMe hats, which offers various models that support different drive sizes and allow GPIO access in some cases, which are all compatible with the GeeekPi Metal Case for a convenient, all-in-one solution."

Choosing one of these GeeekPi models with GPIO throughput access provides flexibility for expansion while fitting within the GeeekPi Metal Case.

GeeekPi N16 Quad M.2 M-Key NVMe SSD HAT Recommended

GeeekPi N16 Quad M.2 M-Key NVMe SSD HAT

Buy from Amazon USA
Buy from Amazon UK

Depending on your location, availability for these models may vary, making them harder to source compared to more widely available options.

Honourable Mentions: Additional NVMe Case Options.

In addition to the previously discussed NVMe HATs, two notable all in one cases have emerged that integrate NVMe support for the Raspberry Pi 5:

The first being the Argon Neo 5 M.2 NVME PCIe case for the Raspberry pi 5.

The second being the Argon One V3 M.2 NVMe Raspberry Pi 5 case.

Argon NEO 5 M.2 NVME PCIE Case for Raspberry Pi 5 Recommended

Argon NEO 5 M.2 NVME PCIE Case for Raspberry Pi 5

Buy from Amazon USA
Buy from Amazon UK
Argon ONE V3 M.2 NVME PCIE Case for Raspberry Pi 5 Recommended

Argon ONE V3 M.2 NVME PCIE Case for Raspberry Pi 5

Buy from Amazon USA
Buy from Amazon UK

These cases provide integrated solutions for adding NVMe storage to the Raspberry Pi 5, each with unique features catering to different user preferences. While they offer enhanced cooling and a polished design, considerations regarding direct GPIO access and pricing should be taken into account based on your specific project needs.

NVMe Choice Conclusion.

So, after comparing these options, I’ve decided to go with the Pimoroni NVMe Base for this series. Its flexibility, direct GPIO access, compatibility with a wide range of NVMe drives, and ability to add additional hats on top make it the best choice for our setup.

Later on, I will be installing this hat and showcasing its performance so we can see exactly how it measures up.

Storage Options and Compatibility.

Now that we've explored the available NVMe hats for the Raspberry Pi 5, let's focus on selecting the appropriate NVMe storage. Choosing the right drive is crucial for optimal performance and compatibility.

When selecting an NVMe drive, consider both the form factor and keying.

Form Factor and Keying.

The Pimoroni NVMe Base supports M.2 NVMe SSDs with an M-key, accommodating sizes from 2230 to 2280. This flexibility allows you to choose a drive that fits your storage needs and physical space constraints.

M.2 form factors are denoted by four digits: the first two indicate the width (typically 22mm), and the last two represent the length. For instance, a 2280 drive is 22mm wide and 80mm long.

Ensuring your chosen drive matches one of the supported sizes—2230, 2242, 2260, or 2280—is essential for proper installation.

Performance and Compatibility.

Beyond physical dimensions, performance is a key consideration. The Raspberry Pi 5 operates at PCIe 2.0 x1 speeds, with a maximum throughput of approximately 500MB/s. While many NVMe drives are designed for higher speeds, they will operate at the Pi's maximum capability. Therefore, investing in a high-end NVMe drive may not yield significant performance gains over a mid-range option in this setup.

Pimoroni has tested the NVMe Base with several M.2 NVMe drives, confirming compatibility. Some of these drives include:

  • AData Legend 700
  • AData Legend 800
  • AData XPG SX8200 Pro
  • Axe Memory Generic Drive
  • Crucial P2 M.2
  • Crucial P3 M.2
  • Crucial P3 Plus M.2
  • Inland PCIe NVMe SSD
  • Kingston KC3000
  • Kioxia Exceria NVMe SSD
  • Kioxia Exceria G2 NVMe SSD
  • Lexar NM620
  • Lexar NM710
  • Netac NV2000 NVMe SSD
  • Netac NV3000 NVMe SSD
  • Origin Inception TLC830 Pro NVMe
  • Sabrent Rocket 4.0
  • Sabrent Rocket Nano
  • Samsung 980
  • Samsung 980 Pro (500GB/1TB)
  • Team MP33
  • Western Digital Black SN750 SE 

Opting for one of these tested drives can provide assurance of compatibility and reliable performance with the Pimoroni NVMe Base.

I have chosen to go with the Netac NV3000 NVMe SSD as it is listed on the drive compatibility list and should work well with this Pimoroni nvme hat. This drive comes in various sizes but for our needs 500GB will be perfect.

Installing the Pimoroni NVMe Base.

Now that we've selected our NVMe drive and the Pimoroni NVMe Base, let's walk through the installation process to enhance our Raspberry Pi 5's storage capabilities.

As this blog post is getting a bit to long if you would like to see the installation of the Pimoroni NVMe Base please see our dedicated YouTube video tutorial. I have bookmarked the correct timestamp so just click the link below to go straight to the correct point in the tutorial. Please come back after to finish off the setup.

YouTube Video

Alternatively you can follow the official guide here: https://learn.pimoroni.com/article/getting-started-with-nvme-base

Transferring Raspberry Pi OS to NVMe.

Now that we’ve successfully installed the Pimoroni NVMe Base and connected our NVMe drive, it’s time to take the next steps.

Step 1: Update the Raspberry Pi 5 packages and firmware.

First we need to make sure the Raspberry Pi software is up to date.

This is to make sure that the Raspberry Pi has the latest bug and security patches as well as the latest packages and firmware updates to work with the latest technologies like the NVMe drive.

To update the packages and latest security and bug fixes. This command combines two commands together and uses the -y flag to accept any prompts automatically.

sudo apt update && sudo apt upgrade -y

Running the above command should update the firmware of the Raspberry Pi automatically. To check the firmware version and to make sure it is up to date run the following command:

sudo rpi-eeprom-update

You should get a similar output as this.

Note: If for any reason you need to manually update the firmware please watch the video tutorial for this episode as it includes a guided tutorial.

Step 2: Confirm NVMe Base and Drive Are Installed Correctly.

Next we have to make sure that the Pimoroni NVMe base was installed correctly. We can do this by testing to see if the NVMe drive has been detected by the Raspberry Pi OS.

We can achieve this by using the ls command and passing the expected path to our NVMe drive.

Type the following into a terminal:

ls /dev/nvme0

If you get a returned value of /dev/nvme0 then that is confirmation that your NVMe drive is being detected by the Raspberry Pi operating system.

If you receive an error saying "ls: cannot access \'/dev/nvme0\': No such file or directory" or similar it could be that you need to go over the Pimoroni NVMe base install and make sure you have connected the ribbon cable correctly. This is most likely the problem. If you are still having problems after checking this you may need a ribbon cable replacement and I would advise you to reach out to Pimoroni for a replacement ribbon cable.

Step 3: Use the Raspberry Pi Imager To Install Raspberry Pi OS To NVMe Drive.

Now we will need to install a fresh Raspberry Pi OS 64 bit Desktop operating system image onto the NVMe drive. This can be achieved in several different ways. You can clone the installation, install the OS over the network or you can use the Raspberry Pi imager from your existing SD card installation. The later being our chosen method.

From the Raspberry Pi OS desktop click the "Raspberry Pi icon" to show the installed applications menu. From there go to "Accessories", then select "Raspberry Pi Imager" from the drop down menu.

From the Raspberry Pi Imager click on "Choose Device".

Select the "Raspberry Pi 5".

Now select the operating system by clicking on "Choose OS".

Now select "Raspberry Pi OS (64-bit)" from the Operating System menu.

Next from the main Raspberry Pi Imager menu click on "Choose Storage" and select your NVMe drive from the list.

Click "Next".

Click on "Edit Settings" to set any custom settings and follow the prompts.

If you do not require custom settings than click "No" on the Use OS customisation?.

The Raspberry Pi Imager will write to the NVMe drive and verify the integrity of the installation.

Enter your password if a prompt box shows.

Once the Raspberry Pi imager has finished you can click "Continue" and then close the Raspberry Pi imager.

Setting The Boot Priority To The NVME Drive.

Now that we have installed the Raspberry Pi OS onto the NVMe drive we now have to set the boot priority so that the Raspberry Pi 5 will boot to the NVMe drive.

Open up a terminal and use the "raspi-config" command to open up the Raspberry Pi configuration tool.

raspi-config

From the Raspberry configuration tool menu select "6 Advanced Options".

Next select "A4 Boot Order".

Next Select "B2 NVMe/USB Boot Boot from NVMe before trying USB and SD Card"

Press enter on the remaining prompt then "Finnish" and then when prompted to reboot now select "Yes" to reboot your Raspberry Pi.

Note: You can now remove your Micro SD Card from the Raspberry Pi 5 as it is no longer needed.

Once the Raspberry Pi 5 reboots you should now be booted into your NVMe Raspberry Pi Desktop OS.

Follow-Up Benchmark Tests Using The NVMe.

Now that we have the NVMe installed and the Raspberry Pi 5 booting from it we can run some follow up tests. I will not bore you by going over the tests again. I will just display the results for you in our section below and explain what they mean.

Enabling Gen 3 PCIe Speeds (Experimental).

There is also an experimental setting that we can try to enable Gen 3 speeds on the PCIe port and NVMe drive.

I am going to try this setting and display it in our tests to see what performance gains can be had using Gen 3 over Gen 2.

If you would like to enable the experimental Gen 3 speeds on your raspberry pi please follow our guide below:

To enable "Gen 3 PCIe 3" mode, open a terminal window and type:

sudo nano /boot/firmware/config.txt

Add the following line to the [all] section at the end of the file:

dtparam=pciex1_gen=3

Save the file using "Ctrl+X" then "y" and then press "Enter".

Reboot your Raspberry Pi 5 then you enjoy the faster performance from Gen 3.

"A quick note here: enabling Gen 3 support is experimental, and I wouldn’t recommend relying on it in a production environment. That said, after researching online, the general consensus is that it works well in most cases. It’s something to keep in mind if you’re considering enabling it."

Benchmark Performance Test Results.

So we are now going to look at the results of our benchmark tests.

Boot Time Test Results.

We are going to look at the average boot times first.

For all of our benchmark tests we ran three tests consecutively then we averaged out the results.

So as you can see the Micro SD Card on average boots at 11.83s. The NVMe Gen 2 was 10.99s and the NVMe Gen3 was 10.92s.

So I was a little surprised by these boot times. I thought we would see a bit more of a speed gain using the NVMe drive. However, i would add that it is still early days for the Raspberry Pi 5 development and using NVMe hat drives that we may see improved speeds with future Operating system updates.

So a 1 second gain in boot times is not a significant performance boost but it is still faster than the Micro SD card.

Read and Write Speed Test Results.

Next we are going to compare the read and write speeds. As you can see from the graph the NVMe read and write speeds have significant improvements over the Micro SD card.

The Gen 3 setting is showing a marginal improvement over the Gen 2. It would just be interesting to see if this comes at a cost to stability as this feature is experimental. Time will tell. I will let you know my findings in a future episode.

Full Test Results and Benchmark Scores.

Finally I will give you the full results from our tests and give you the benchmark scores.

Conclusion.

In conclusion, upgrading to an NVMe drive on the Raspberry Pi 5 is an impressive upgrade, delivering substantial performance gains compared to the traditional microSD card. The benefits are not just in speed but also in reliability, stability, and data integrity—making this upgrade a worthwhile consideration for anyone looking to get the most out of their Raspberry Pi 5.

When planning your upgrade, it’s essential to carefully select your NVMe hat, drive, and case. Compatibility between these components is crucial, as form factor and GPIO access can sometimes be a challenge. Thankfully, there are many excellent options available, and as we’ve seen, there’s something to suit every need and budget.

For those who want a simplified approach, there are all-in-one solutions—cases that include NVMe hat functionality. These options can take the hassle out of compatibility concerns but often come at a higher cost and may have limited availability depending on your region.

Overall, upgrading to NVMe storage opens up a world of possibilities for performance and versatility, especially when paired with the powerful new features of the Raspberry Pi 5.

All that’s left to say now is thank you for your time.

Support My Work!

Buy Me A Coffee

Click The Image To Go To Site

Buy Me A Coffee

I Am An Affiliate!

Just so you know, we may collect a share of sales or other compensation from the links on this page. As an Amazon Associate, I earn from qualifying purchases.

The affiliate link recommendations come at no extra cost to you.

We hope you love the products we recommend!

Thank you if you use our links; we really appreciate the support!

0 Comments

Support My Work!

Buy Me A Coffee

Click The Image To Go To Site

Buy Me A Coffee

I Am An Affiliate!

Just so you know, we may collect a share of sales or other compensation from the links on this page. As an Amazon Associate, I earn from qualifying purchases.

The affiliate link recommendations come at no extra cost to you.

We hope you love the products we recommend!

Thank you if you use our links; we really appreciate the support!