The Raspberry Pi 5 has a PCIe connector that, with an M.2 HAT, lets you use an NVMe SSD as the boot drive. You gain speed and, above all, reliability over the microSD. This guide explains the assembly, bootloader configuration and how to move your current system to the SSD.
In short
- You need an M.2 HAT (official or third-party), a 2230 or 2242 NVMe SSD and an up-to-date EEPROM (newer than December 6, 2023).
- Boot order is set in the EEPROM’s
BOOT_ORDERvariable;0xf416tries NVMe, then microSD, then USB.- You can install a clean system with Raspberry Pi Imager or clone your current microSD to the SSD.
Data from the official documentation: boot loader and M.2 HAT+.
What you need
| Component | Detail |
|---|---|
| Raspberry Pi 5 | The Pi 4 has no accessible PCIe |
| M.2 HAT | The official M.2 HAT+ takes 2230 and 2242; the Compact only 2230 |
| NVMe SSD | M-key, size compatible with the HAT |
| Official 27 W supply | The SSD adds draw; a marginal supply causes freezes |
| microSD with Raspberry Pi OS | To update the EEPROM and clone |
PCIe speed
| Mode | Theoretical speed | Status |
|---|---|---|
| PCIe 2.0 x1 (default) | about 500 MB/s | Supported and certified |
| PCIe 3.0 x1 | about 1 GB/s | Possible but not certified; may be unstable |
Even on PCIe 2.0, NVMe is several times faster than a good microSD.
Step 1: update the system and EEPROM
Boot from the microSD and update:
sudo apt update && sudo apt full-upgrade -y
sudo rpi-eeprom-update
The command shows the date of the installed version. If it is older than December 6, 2023:
- Run
sudo raspi-config. - Advanced Options → Bootloader Version → Latest.
- Apply the update and reboot:
sudo rpi-eeprom-update -a
sudo reboot
Step 2: fit the M.2 HAT
Always with the Pi unplugged:
- If you use the Active Cooler, install it first.
- Fit the standoffs and the GPIO extension header.
- Insert the ribbon cable into the Pi’s PCIe connector with the metal contacts facing the USB ports and close the latch.
- Screw on the HAT and connect the other end with the copper contacts facing up.
- Insert the SSD at an angle, lower it and secure it with the screw without over-tightening.
On power-up, check it is detected:
ls -l /dev/nvme*
You should see /dev/nvme0 and /dev/nvme0n1. If nothing appears, check the ribbon cable orientation and latch.
Step 3: move the system to the SSD
Option A: clean install (recommended)
- Open Raspberry Pi Imager on the Pi itself.
- Choose the model, Raspberry Pi OS and, as storage, the NVMe SSD.
- Set user, Wi-Fi and SSH in the customization options and write the image.
Option B: clone the microSD
If everything is already set up, you can copy the microSD as is. Raspberry Pi OS with desktop has SD Card Copier (Accessories menu):
- Source: the microSD (
/dev/mmcblk0). - Destination: the SSD (
/dev/nvme0n1). - Click Start and wait.
The copy adjusts partitions to the SSD size. Without a desktop there are community tools such as rpi-clone, but they are not part of the system.
Cloning a running system with services writing (databases, Docker) can leave files half written. In those cases, a clean install and data restore is better.
Step 4: change the boot order
If you remove the microSD, the Pi 5 already boots from NVMe. If you leave it in, by default it tries the microSD first. There are two ways to change that.
With raspi-config
sudo raspi-config
Advanced Options → Boot Order → NVMe/USB Boot, then Finish and reboot.
Editing the EEPROM
sudo rpi-eeprom-config --edit
Change or add the BOOT_ORDER line:
[all]
BOOT_ORDER=0xf416
Save, close and reboot. The change applies on the next boot.
How to read BOOT_ORDER
Each hexadecimal digit is a boot mode and is read right to left:
| Code | Mode |
|---|---|
1 | microSD card |
2 | Network |
4 | USB (drive or stick) |
6 | NVMe |
7 | HTTP |
e | Stop |
f | Start over |

Examples:
| Value | Order |
|---|---|
0xf41 | microSD → USB → repeat |
0xf46 | NVMe → USB → repeat |
0xf416 | NVMe → microSD → USB → repeat |
To view the current configuration without editing:
rpi-eeprom-config
Enable PCIe 3.0 (optional)
To try the faster mode, add to /boot/firmware/config.txt:
dtparam=pciex1_gen=3
Reboot. If you get disk errors or freezes, remove the line: the Pi 5 is not certified for Gen 3 and not every SSD and HAT can take it.
Common problems
| Symptom | Cause and fix |
|---|---|
/dev/nvme0n1 does not appear | Ribbon cable wrong way or latch open. Check with the Pi off |
| Missing with a third-party HAT | Some do not follow the HAT+ spec. Add PCIE_PROBE=1 in the EEPROM |
| Still boots from microSD | BOOT_ORDER unchanged. Check with rpi-eeprom-config |
| Boots from nothing | Old EEPROM. Update it with a microSD |
| Freezes or I/O errors | Weak supply or unstable PCIe 3.0. Use the 27 W supply and go back to Gen 2 |
| Incompatible SSD | Some controllers cause trouble. Check the HAT maker’s compatibility lists |
Frequently asked questions
Can I leave the microSD in?
Yes. With BOOT_ORDER=0xf416 it boots from NVMe and the microSD remains a plan B if the SSD fails.
Does it run hotter?
The SSD adds heat next to the processor. The Active Cooler is compatible with the standard M.2 HAT+ and is a good idea if you overclock.



