In short: Power off and reseat the ribbon cable the right way round, then boot from an SD card and run ls -l /dev/nvme*. If nothing is listed, update the bootloader to a release dated 6 December 2023 or later; with a non-HAT+ adapter, add dtparam=pciex1. If the drive is seen but will not boot, set BOOT_ORDER=0xf416. If you forced PCIe Gen 3, go back to Gen 2.
| Detection check | ls -l /dev/nvme* should list /dev/nvme0 and /dev/nvme0n1 |
|---|---|
| Firmware needed | bootloader dated 6 December 2023 or later |
| Non-HAT+ adapters | dtparam=pciex1 in /boot/firmware/config.txt, PCIE_PROBE=1 to boot |
| Boot from NVMe | BOOT_ORDER=0xf416 in the bootloader config |
| Speed | Gen 2 by default; Gen 3 is not certified and might be unstable |
| M.2 HAT+ sizes | 2230 and 2242 (Compact: 2230 only), M key |
1. Power off, then check the cable and the drive size
Raspberry Pi's first rule for the M.2 HAT+: "Always disconnect your Raspberry Pi from power before connecting or disconnecting a device from the M.2 slot." Then the ribbon cable, which is the most common physical fault. At the Pi end, insert it with the metal contacts facing the USB ports; at the HAT end, with the copper contacts facing up. It has to sit fully and evenly in both connectors.
Check the drive fits the board. The M.2 HAT+ takes M key drives in the 2230 or 2242 form factor; the M.2 HAT+ Compact takes 2230 only. A 2280 drive, the common desktop size, does not fit either of them. The Raspberry Pi SSD is a 2230 drive (Raspberry Pi SSD on Amazon).
2. Ask Linux whether it sees the drive
Boot from an SD card and run:
ls -l /dev/nvme*A detected drive appears as /dev/nvme0 and /dev/nvme0n1. If you see them, the hardware works: a new or unformatted drive simply does not appear as an icon on the desktop, as the M.2 HAT+ page notes. Skip to step 5 if your problem is booting.
If nothing is listed and you use an adapter that is not a HAT+ (a board without the HAT+ identification), the connector is off: "By default, the PCIe connector is not enabled unless connected to a HAT+ device." Add this line to /boot/firmware/config.txt and reboot (the alias nvme also works):
dtparam=pciex13. Update the bootloader and the system
The M.2 HAT+ page has you check the bootloader date first:
sudo rpi-eeprom-updateIf it shows 6 December 2023 or later, carry on. If older, open sudo raspi-config, choose Latest under Bootloader Version, then apply and reboot:
sudo rpi-eeprom-update -aThe NVMe boot page also asks for current software before anything else:
sudo apt update && sudo apt full-upgrade4. If it appears and disappears: go back to Gen 2
The Pi 5 runs its PCIe link at Gen 2.0 (5 GT/s) by default. Many guides suggest dtparam=pciex1_gen=3 or the PCIe Speed option in raspi-config for Gen 3.0 (8 GT/s). Raspberry Pi's warning: "The Raspberry Pi 5 isn't certified for Gen 3.0 speeds. PCIe Gen 3.0 connections might be unstable." Its performance page goes further: forcing it "can lead to data corruption or system instability if the connected HAT or ribbon cable can't handle the increased frequency."
A drive that vanishes under load, throws I/O errors or fails some boots and not others is the textbook case for removing dtparam=pciex1_gen=3 from config.txt. For an agent host that should run unattended, Gen 2 is the boring choice: the HAT+ is a single lane rated at 500 MB/s peak, still far faster than an SD card for the small writes an agent makes.
5. Seen but will not boot: the boot order
"By default, Raspberry Pi devices do not boot from PCIe storage." Edit the bootloader configuration:
sudo rpi-eeprom-config --edit
# set:
BOOT_ORDER=0xf416
# and, with a non-HAT+ adapter, also:
PCIE_PROBE=1The digit 6 in the boot order is NVMe ("For NVMe boot, use boot mode 6"). The same choice is in raspi-config under Advanced Options > Boot Order. Raspberry Pi also notes that with no SD card inserted, a Pi 5 boots from the NVMe drive automatically once it is flashed with Raspberry Pi Imager. If boot still fails after all this, Raspberry Pi asks for an issue on its rpi-eeprom GitHub repository.
Booting from NVMe is also the main fix on SD card corruption, and the full setup, parts and agent notes are on NVMe on the Raspberry Pi 5.
Other things worth ruling out
- PCIe switches and dual adapters. "Only certain devices support enumeration of PCIe devices behind a switch." With a board that carries two M.2 slots or an AI accelerator next to the SSD, test the SSD on its own first.
- Power. The M.2 HAT+ supplies up to 3 A to the drive from the Pi. A board on a weak supply has less to give; see the power supply warning page.
- Cooling. You cannot fit the Active Cooler beneath the M.2 HAT+ Compact. The SSD Kit includes a 16 mm stacking header and spacers so the HAT+ fits with an Active Cooler.
What to buy
- Raspberry Pi M.2 HAT+: a HAT+ board: the connector is enabled without dtparam=pciex1; takes 2230 and 2242 drives.
- Raspberry Pi SSD, M.2 2230: the size the HAT+ takes; 256 GB, 512 GB or 1 TB.
- Raspberry Pi 27W USB-C power supply: the recommended supply, so the board has its full power budget.
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
Why does ls /dev/nvme* show nothing on my Pi 5?
Do I need dtparam=pciex1 with the official M.2 HAT+?
Should I enable PCIe Gen 3 for my NVMe drive?
The drive is detected but the Pi boots from the SD card. Why?
Will a 2280 NVMe SSD work on the M.2 HAT+?
Sources
- Raspberry Pi documentation, M.2 HAT+, read on 21 November 2026.
- Raspberry Pi documentation source, PCIe, read on 21 November 2026.
- Raspberry Pi documentation source, boot from NVMe, read on 21 November 2026.
- Raspberry Pi documentation source, performance (PCIe speed), read on 21 November 2026.
- Raspberry Pi documentation, SSDs, read on 21 November 2026.
- Raspberry Pi documentation, SSD Kit, read on 21 November 2026.