HardwareParts and accessories

Raspberry Pi 5 NVMe: which HAT, which SSD, and how to boot from it

The Raspberry Pi 5 is the first Pi with a PCIe connector: a small ribbon socket on the edge of the board that carries one PCIe 2.0 lane. Put an M.2 HAT on it and the agent host runs from an NVMe SSD instead of a microSD card. This page is the buyer's side: which HAT, which drive, which speed setting and how to make the board boot from it. If you already have the parts and the drive does not show up, the checks are on Pi 5 NVMe not detected.

In short: The boring choice is Raspberry Pi's own M.2 HAT+ with a Raspberry Pi SSD, or the SSD Kit that bundles the two with the header for an Active Cooler. Leave the link at its default Gen 2 speed: Raspberry Pi does not certify the Pi 5 for Gen 3. A 256 GB drive is plenty for an agent that calls a cloud model.

The board this page is about: a Raspberry Pi 5, 8 GB for an agent with a cloud model.
Buy the Raspberry Pi 5 on Amazon
At a glance
Connector on the Pi 5FPC ribbon socket, PCIe Gen 2.0 x1 (5 GT/s); needs an M.2 HAT or another adapter
M.2 HAT+M key, 2230 or 2242 drives, 500 MB/s peak transfer rate, up to 3 A to the drive
M.2 HAT+ CompactM key, 2230 drives only; fits around the fan of the official case, not over an Active Cooler
Raspberry Pi SSD256 GB, 512 GB or 1 TB; M.2 2230; PCIe Gen 3 compliant; NVMe 1.4
Gen 3 speed8 GT/s with dtparam=pciex1_gen=3; not certified on the Pi 5, may be unstable
Boot from NVMeBOOT_ORDER=0xf416 in the bootloader config, or Boot Order in raspi-config

Which HAT: HAT+, HAT+ Compact or the SSD Kit

Raspberry Pi makes two M.2 boards for the Pi 5 and sells one of them in a kit with its own drive. All three use the M key edge connector, which is the one NVMe drives use. The difference is the drive length they take and what fits underneath.

BoardDrive sizesCooling underneathGood for
M.2 HAT+2230 and 2242Sits above the board; the SSD Kit version ships a 16 mm stacking header for an Active CoolerMost agent hosts, and the widest choice of drives
M.2 HAT+ Compact2230 onlyDesigned to fit around the fan of the official Raspberry Pi 5 case; the Active Cooler cannot go beneath itA Pi that lives in the official case
SSD KitShips with a Raspberry Pi SSD (2230)Includes the 16 mm stacking header, spacers and screws so it fits with an Active CoolerOne purchase, nothing to match

A 2280 drive, the long size most desktop SSDs use, is not among the sizes either HAT takes. If you already own one, a third-party adapter can carry it, but then it is not a HAT+ device and the boot settings below need one more line. Raspberry Pi also notes that only certain devices support PCIe devices behind a switch, so boards that split the lane into two slots are a gamble we would skip for an always-on host.

Which SSD, and what the SD card gives you instead

Any 2230 or 2242 M key NVMe drive goes in the M.2 HAT+. Raspberry Pi's own SSD is the drive with published figures for this board. Its documentation gives 4 kB random IOPS per capacity, and the official microSD card's figures on a Pi 5 for comparison:

Storage (Raspberry Pi's figures)4 kB random read IOPS4 kB random write IOPS
Raspberry Pi SSD 256 GB40,00070,000
Raspberry Pi SSD 512 GB50,00090,000
Raspberry Pi SSD 1 TB90,00090,000
Raspberry Pi microSD card, on a Pi 5 (SDR104)5,0002,000

Small random writes are what an agent does all day: logs, a SQLite database, session files, Docker layers. That is where the gap is widest. Raspberry Pi publishes no endurance (TBW) figure for its SSDs, so we cannot compare wear between drives. For capacity: an agent with a cloud model fits easily in 256 GB; take 512 GB or 1 TB only if you plan to keep local model files on the board, and see how much SSD space local models need before you decide. The drive runs at the Pi's PCIe 2.0 speed whatever it is rated for, so a fast Gen 4 drive buys nothing here.

Gen 2 or Gen 3: leave it at Gen 2

By default the Pi 5 runs the link at Gen 2.0 speed, 5 GT/s, which the M.2 HAT+ documentation gives as a 500 MB/s peak transfer rate. You can force Gen 3.0 (8 GT/s) with one line in /boot/firmware/config.txt:

dtparam=pciex1_gen=3

or in raspi-config under Advanced Options, PCIe Speed. Raspberry Pi's warning comes with both: "The Raspberry Pi 5 isn't certified for Gen 3.0 speeds. PCIe Gen 3.0 connections might be unstable." Its performance page is blunter: forcing the higher rate "can lead to data corruption or system instability if the connected HAT or ribbon cable can't handle the increased frequency", and it advises against the setting unless a HAT requires it.

For an agent host the choice is easy. The agent spends its time waiting on the network and on the model provider, not reading the disk at full speed, and a corrupted system disk costs far more than a faster boot saves. That is our reading of the workload, not a measurement: keep Gen 2.

Fitting it and booting from it

The steps, in order, as Raspberry Pi documents them:

  1. Disconnect the Pi from power before you connect or disconnect anything in the M.2 slot.
  2. Seat the ribbon cable fully and evenly: at the Pi end with the metal contacts facing the USB ports, at the HAT end with the copper contacts facing up.
  3. Update first. Run sudo apt update && sudo apt full-upgrade, then sudo rpi-eeprom-update: the bootloader should date from 6 December 2023 or later. If it is older, choose Latest under Bootloader Version in raspi-config, run sudo rpi-eeprom-update -a and reboot.
  4. Check the drive is seen, booted from the SD card: ls -l /dev/nvme* should list /dev/nvme0 and /dev/nvme0n1. A new, unformatted drive does not appear as an icon on the desktop, which is normal.
  5. Write Raspberry Pi OS (64-bit) to the NVMe drive with Raspberry Pi Imager.
  6. Set the boot order. With no SD card inserted, the Pi 5 boots from the NVMe drive on its own. Otherwise pick an option that includes NVMe under Advanced Options, Boot Order in raspi-config, or edit the bootloader config with sudo rpi-eeprom-config --edit and set:
BOOT_ORDER=0xf416

The 6 in that value is NVMe boot mode. A non-HAT+ adapter also needs PCIE_PROBE=1 in the same file, and dtparam=pciex1 (alias nvme) in config.txt, because the connector is only enabled on its own for HAT+ devices. If the drive still does not appear, go through the checks in order.

Power: the drive draws from the Pi

The M.2 HAT+ supplies up to 3 A to the drive, and that power comes through the Pi. Raspberry Pi recommends its 27 W USB-C supply for the Pi 5 (5.1 V, 5 A). A 3 A supply boots the board, but the firmware then restricts USB peripherals to 600 mA instead of 1.6 A and warns you about it at boot. With an NVMe drive, a cooler and the odd USB device on one board, use the 5 A supply (27 W supply on Amazon). Raspberry Pi adds that low quality supplies can corrupt storage, which is the failure the SSD was meant to remove. The message and its fix are on the Pi 5 power supply warning.

For cooling: an agent with a cloud model keeps the CPU mostly idle, but the Pi 5 starts throttling at 80 °C and the Active Cooler is cheap insurance under a HAT+ with the stacking header (Active Cooler on Amazon). With the Compact HAT in the official case, the case fan does that job.

What to buy

The machine for this setup: the Raspberry Pi 5.
Buy the Raspberry Pi 5 on Amazon

Shop links go through /go/ and open Amazon (amazon.fr in the EU and Switzerland, amazon.com elsewhere). As an Amazon Associate we earn from qualifying purchases. Your price does not change and no brand pays for a place on this page (disclosure). We write no price down: it moves, the shop shows today's.

Questions

Does the Raspberry Pi 5 support NVMe without a HAT?
No. The board has a PCIe 2.0 x1 ribbon connector, not an M.2 slot. You need an M.2 HAT or another adapter between the connector and the drive.
Can I use a 2280 SSD on the Raspberry Pi M.2 HAT+?
Not on Raspberry Pi's boards: the M.2 HAT+ takes 2230 and 2242 drives, the Compact only 2230. A 2280 drive needs a third-party adapter, which then needs PCIE_PROBE=1 to boot.
Should I enable PCIe Gen 3 on the Pi 5?
Not on an agent host. Raspberry Pi certifies the Pi 5 for Gen 2.0 only, warns that Gen 3.0 might be unstable, and says forcing it can lead to data corruption if the HAT or cable cannot keep up.
Can I keep the Active Cooler with an M.2 HAT?
With the full-size M.2 HAT+ and the 16 mm stacking header that comes in the SSD Kit, yes. The HAT+ Compact cannot sit over an Active Cooler: it is designed around the fan of the official case.
Which capacity of Raspberry Pi SSD should I buy?
256 GB covers the OS, Docker images and logs of an agent that calls a cloud model. The larger drives have higher random read IOPS per Raspberry Pi's table, and room for local model files if you want them.

Sources