Quick answer: To boot a Raspberry Pi 5 from NVMe, use a compatible M-key NVMe drive with the official M.2 HAT+ or M.2 HAT+ Compact, update Raspberry Pi OS and bootloader firmware, install the hardware with power disconnected, write Raspberry Pi OS to the SSD, choose NVMe/USB boot when an SD card remains inserted, and verify that
/is mounted from an NVMe device. The proof step matters: seeing an SSD in the desktop does not prove the Pi booted from it.
An NVMe upgrade can turn a Raspberry Pi 5 into a more convincing desktop, development machine or compact server. But the job is not finished when the drive appears in Raspberry Pi OS. You need compatible hardware, correct physical installation, a bootable operating-system image, the right boot order and evidence that the root filesystem actually moved.
This guide follows Raspberry Pi's current documentation for the official M.2 HAT+ family. Third-party adapters can use different cables, power arrangements or configuration steps, so follow the adapter manufacturer's instructions where they differ.
Watch the Raspberry Pi 5 NVMe setup video
The video walks through compatibility, installation, detection, boot order and verification. Use the written checklist below while you build so you can copy commands and troubleshoot in the right order.
Watch Raspberry Pi 5 NVMe SSD Setup: Install, Boot and Verify the M.2 HAT+ on YouTube
What you need before starting
Gather the parts before opening the PCIe connector:
- A Raspberry Pi 5
- An official Raspberry Pi M.2 HAT+ or M.2 HAT+ Compact
- A compatible M-key NVMe SSD
- The ribbon cable, spacers and screws supplied with the HAT+
- A microSD card containing a working Raspberry Pi OS installation for preparation and troubleshooting
- A suitable Raspberry Pi 5 power supply
- Raspberry Pi Imager
- Optional cooling appropriate to your case and workload
The standard M.2 HAT+ supports 2230 and 2242 devices. The Compact model supports 2230 devices. Both connect to the Pi 5's single-lane PCIe 2.0 interface and accept M-key peripherals. The connector shape alone is not enough: an M.2 SATA SSD is not an NVMe SSD and is not supported by this PCIe connection.[1][3]
If you are still choosing the board and accessories, read our Raspberry Pi 5 overview.[5] For sustained workloads, our Raspberry Pi 5 cooling guide explains when the official Active Cooler makes sense.[6]
M.2 HAT+ compatibility: check this before buying
The two official boards fit different physical setups:
| Adapter | Supported drive sizes | Cooling and case notes |
|---|---|---|
| M.2 HAT+ | 2230 and 2242 | Supplied spacers leave room for the Active Cooler. It only fits the official Pi 5 case when the lid and included fan are removed. |
| M.2 HAT+ Compact | 2230 | Designed to fit around the official Pi 5 case fan, but the Active Cooler cannot fit underneath it. |
Raspberry Pi says both boards conform to the HAT+ specification, so current Raspberry Pi software and firmware can detect the board and connected device automatically.[1]
NVMe versus M.2 SATA
"M.2" describes a form factor and connector family, not one storage protocol. NVMe drives communicate over PCIe. M.2 SATA drives use SATA. The official Pi 5 M.2 HAT+ exposes PCIe through an M-key edge connector, so buy a compatible NVMe device in a supported length. Do not assume that any slim M.2 stick will work.
Standard versus Compact HAT+
Choose the standard board when you need 2242 support or want the Active Cooler underneath. Choose Compact when you have a 2230 drive and want compatibility with the official case's integrated fan. This is a mechanical decision as much as an electrical one; measure twice before ordering a stack of parts that cannot occupy the same space.
Step 1: update Raspberry Pi OS and bootloader firmware
Do this while the existing microSD installation still works. Open a terminal and update Raspberry Pi OS:
sudo apt update
sudo apt full-upgrade
Check the bootloader firmware:
sudo rpi-eeprom-update
Raspberry Pi's M.2 HAT+ guide specifies bootloader firmware dated December 6, 2023 or later. If yours is older, open the configuration tool:
sudo raspi-config
Choose Advanced Options, then Bootloader Version, then Latest. Exit and apply the update:
sudo rpi-eeprom-update -a
sudo reboot
The official HAT+ is intended to be auto-detected by current software and firmware. Updating first removes an avoidable variable before you troubleshoot the cable or SSD.[1]
Step 2: shut down and disconnect power
Shut the Pi down cleanly:
sudo shutdown -h now
Wait for activity to stop, then unplug the power supply. Raspberry Pi explicitly warns users to disconnect power before connecting or disconnecting anything from the M.2 slot.[1]
Never reseat the PCIe ribbon cable or NVMe drive while the Pi is powered. Tiny connectors are not impressed by optimism.
If you use the standard HAT+ with the official Active Cooler, install the cooler before mounting the HAT+. The Compact board and Active Cooler do not fit together.[1]
Step 3: install the M.2 HAT+ and NVMe SSD
The exact arrangement differs between the standard and Compact boards, so keep the official instruction sheet beside you.
Install the standard M.2 HAT+
- Fit the supplied spacers to the Raspberry Pi 5.
- Press the stacking header evenly onto all GPIO pins.
- Lift both sides of the Pi 5 PCIe connector latch.
- Insert the ribbon cable fully and evenly with its copper contacts facing inward, toward the USB ports.
- Close both sides of the latch.
- Set the HAT+ onto the spacers and secure it with the supplied screws.
- Insert and lock the other end of the ribbon cable at the HAT+. On this end, the copper contacts face up.
Do not force the latch or pull on the cable at an angle. A ribbon cable that is slightly crooked can leave the entire SSD invisible.
Install the NVMe drive
Remove the drive attachment screw, slide the NVMe drive into the M-key connector at a slight upward angle, and then press it down gently. Secure it with the supplied attachment screw. Raspberry Pi says the drive should slide into the slot without force and warns against overtightening the screw.[1]
The user-supplied featured image for this article is an illustration, not an assembly diagram. Use the official orientation images for the cable and mounting hardware.
Step 4: confirm that Raspberry Pi OS detects the SSD
Boot from the existing microSD card first. Once Raspberry Pi OS loads, check for NVMe device nodes:
ls -l /dev/nvme*
A detected drive normally appears as /dev/nvme0n1. List block devices with useful context:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS,MODEL
At this stage you are only confirming detection. The root filesystem will still be on the microSD card, which is expected.
If /dev/nvme0n1 does not appear, stop. Do not start adding random settings copied from old forum threads. Power down and work through the troubleshooting section below.
Step 5: write Raspberry Pi OS to the NVMe SSD
Raspberry Pi's documentation supports using Raspberry Pi Imager from the Pi itself while it is running from an SD card.[1] You can also connect the NVMe SSD to another computer with suitable hardware.
- Open Raspberry Pi Imager.
- Choose the correct Raspberry Pi model.
- Choose Raspberry Pi OS or the operating system required by your project.
- Select the NVMe SSD as the storage target.
- Review the capacity and device identity carefully.
- Configure the hostname, username, network, locale and SSH settings you need.
- Write and verify the image.
Warning: Imaging erases the selected drive. Disconnect unnecessary storage and confirm the target before clicking Write. Raspberry Pi's getting-started guide treats Imager as the standard method for installing an OS to boot media.[4]
Do not assume the desktop label is enough to identify the drive. Compare its model and capacity with lsblk before writing.
Step 6: set the Pi 5 boot order
If no microSD card is inserted, an up-to-date Raspberry Pi 5 with the official M.2 HAT+ should try to boot from the NVMe drive automatically.[1][2]
If you want to keep the SD card inserted, boot Raspberry Pi OS from the card and run:
sudo raspi-config
Choose:
- Advanced Options
- Boot Order
- NVMe/USB boot
Finish and reboot:
sudo reboot
This guide covers NVMe attached over the Pi 5 PCIe interface. If you are booting an SSD through USB instead, use our separate Raspberry Pi USB and SSD boot guide.[7] The hardware path and model-specific requirements are different.
Step 7: prove the Pi is running from NVMe
A successful desktop boot is not proof. The Pi may have fallen back to the microSD card.
Ask Linux which device supplies the root filesystem:
findmnt -no SOURCE /
Then show the block-device tree:
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS,MODEL
The source for / should point to a partition under an NVMe device, commonly something like /dev/nvme0n1p2. Device and partition numbers can vary, so verify the relationship rather than copying that example blindly.
Perform three final checks before migrating important data:
- Reboot normally.
- Shut down fully, remove power briefly and cold-boot.
- Confirm
findmnt -no SOURCE /after each start.
That boring verification step is what separates a working migration from a convincing-looking accident.
Raspberry Pi 5 NVMe not detected: troubleshooting order
1. Confirm the Pi is fully powered off
Disconnect power before touching the HAT+, cable or SSD. Hot-plugging the M.2 hardware is not supported.[1]
2. Check the drive type and length
Confirm that the device is an M-key NVMe SSD. The standard HAT+ accepts 2230 and 2242 lengths; Compact accepts 2230 only. An M.2 SATA drive is the wrong protocol.[1][3]
3. Reseat both ribbon-cable ends
Open each latch from both sides, align the cable evenly and reinsert it in the orientation shown by the official guide. Secure the latch without forcing it.
4. Reseat the NVMe SSD
The drive should enter the M-key connector at a slight angle without excessive force. Confirm that it sits flat and is secured without overtightening.
5. Update software and EEPROM firmware
Boot from microSD, run the update commands from Step 1, and reboot. The HAT+ auto-detection path assumes current Raspberry Pi software and firmware.[1]
6. Return to PCIe Gen 2
The official HAT+ uses single-lane PCIe 2.0 with a stated peak interface rate of 500 MB/s. Raspberry Pi warns that the Pi 5 is not certified for PCIe Gen 3 and that Gen 3 connections may be unstable.[1][3] If you enabled Gen 3 during experimentation, return to the supported baseline before diagnosing unexplained errors.
7. Separate detection from boot problems
If /dev/nvme0n1 exists while booted from microSD, the hardware is being detected. Focus next on the OS image and boot order. If no NVMe device exists, stay with firmware, cable, drive and HAT+ checks.
What performance should you expect?
Raspberry Pi lists the official M.2 HAT+ interface at a 500 MB/s peak transfer rate over one lane of PCIe 2.0.[1][3] That is an interface specification, not a guaranteed benchmark.
Actual storage performance depends on the SSD controller, filesystem, free space, queue depth, workload, temperature, power and software. This article does not claim an observed speed because no raw benchmark dataset was supplied with the task. If you benchmark your own system, record the Pi model, SSD, HAT, firmware, operating system, cooling, command, sample count and temperature. A number without its test conditions is decoration.
For many desktop and server workloads, the practical benefits are responsiveness, capacity and a storage setup better suited to sustained writes than a typical low-end microSD card. The value depends on what the Pi actually does; an idle dashboard does not need the same storage as a database or build server.
Frequently asked questions
Can Raspberry Pi 5 boot directly from NVMe?
Yes. Raspberry Pi's official M.2 HAT+ documentation says a Pi 5 without an SD card inserted can boot automatically from an NVMe drive after an operating system has been installed on it. If an SD card remains inserted, choose NVMe/USB boot in raspi-config.[1]
Does the M.2 HAT+ support every M.2 SSD?
No. The official board uses an M-key PCIe connection for compatible NVMe devices. The standard board supports 2230 and 2242 lengths; Compact supports 2230. M.2 SATA is not supported by this PCIe path.[1][3]
Do I need to add dtparam=pciex1?
Not for the normal official M.2 HAT+ workflow described in the current documentation. The board conforms to the HAT+ specification and is auto-detected by current Raspberry Pi software and firmware.[1] Third-party adapters may have different instructions.
Should I enable PCIe Gen 3?
Not as the default setup. Raspberry Pi states that Pi 5 is not certified for Gen 3 speeds and warns that the connection may be unstable.[1] Establish a reliable Gen 2 system first.
How do I know the Pi did not boot from the SD card?
Run findmnt -no SOURCE /. The reported root source should be a partition belonging to the NVMe device. Confirm with lsblk.
Final checklist
Before calling the upgrade finished, verify all of these:
- The SSD is M-key NVMe in a supported length.
- Raspberry Pi OS and bootloader firmware are current.
- Power was disconnected during hardware work.
- The ribbon cable is fully inserted and correctly oriented at both ends.
/dev/nvme0n1appears while booted from microSD.- Raspberry Pi OS was written to the intended NVMe target.
- NVMe/USB boot is selected when an SD card remains installed.
findmnt -no SOURCE /shows an NVMe partition.- Normal reboot and cold boot both succeed.
- Any benchmark claim records the complete test method.
The hardware upgrade is the flashy part. Verification is the part that makes it real.
Sources
[1] https://www.raspberrypi.com/documentation/accessories/m2-hat-plus.html — Raspberry Pi M.2 HAT+ documentation [2] https://www.raspberrypi.com/documentation/computers/raspberry-pi.html — Raspberry Pi computer hardware and NVMe boot documentation [3] https://www.raspberrypi.com/products/m2-hat-plus — Raspberry Pi M.2 HAT+ product page [4] https://www.raspberrypi.com/documentation/computers/getting-started.html — Raspberry Pi getting started documentation [5] https://raspians.com/raspberry-pi-5 — Raspians Raspberry Pi 5 overview [6] https://raspians.com/raspberry-pi-5-cooling — Raspians Raspberry Pi 5 cooling guide [7] https://raspians.com/raspberry-pi-boot-from-usb-ssd-or-flash-drive — Raspians USB and SSD boot guide