Tutorials 9 min read

Boot a Raspberry Pi 5 on NVMe SSD in 2026: The Complete Guide

Boot a Raspberry Pi 5 from an NVMe SSD with the official M.2 HAT+: bootloader update, cloning with SD Card Copier or Raspberry Pi Imager, BOOT_ORDER in the EEPROM, and checks.

See our picks
S By Selfhostr Team · no sponsored content
Boot a Raspberry Pi 5 on NVMe SSD in 2026: The Complete Guide
ⓘ ⓘ This article may contain affiliate links (no extra cost to you, it funds the site). As an Amazon Associate, Selfhostr earns from qualifying purchases. See the disclosure.
⏱️
~45 min
Duration
🎚️
Intermediate
Difficulty
💶
0 € (free software)
Cost
📦
MicroSD card with Raspbian installed, M.2 HAT+ card
Key Prerequisites

👍 What we like

  • ✓Official, documented method with no manual partitioning.
  • ✓An SSD is more durable and more responsive than a microSD card for homelab use.
  • ✓The microSD stays available as a rescue card thanks to the boot order.

👎 What to watch

  • ✕PCIe 2.0 x1 link only: fast SSDs are heavily limited, and Gen 3 is not certified.
  • ✕The M.2 HAT+ only takes 2230 and 2242 drives (2230 only for the Compact version).
  • ✕The standard HAT sits on top of the Pi and only fits the official case with the lid and fan removed.

🏆 Our picks

Affiliate links · same price for you
Recommended
Raspberry Pi M.2 HAT+

Raspberry Pi M.2 HAT+

Voir sur Amazon

Amazon · price and availability on the listing

Essential
📦

SanDisk Extreme microSDXC A2 128 Go

Voir sur Amazon

Amazon · price and availability on the listing

High Performance
📦

Samsung 990 PRO 4 To

Voir sur Amazon

Amazon · price and availability on the listing

See all our recommended gear in the shop.

📑 Contents ▾

Booting a Raspberry Pi 5 from an NVMe SSD instead of a microSD card gives you a more responsive system and longer-lasting storage for a homelab. The Pi 5 was the first mainstream Raspberry Pi with a PCIe connector. It is an FPC ribbon connector that provides a PCIe 2.0 x1 link, and you use it with the Raspberry Pi M.2 HAT+. The official method has three stages: you boot from a microSD card first, copy or install Raspberry Pi OS onto the SSD (with SD Card Copier or Raspberry Pi Imager), and then change the boot order. The boot order is a bootloader EEPROM setting (BOOT_ORDER), not a config.txt setting. This guide follows that procedure. It uses no manual formatting, no F2FS and no Windows tools.

Prerequisites

  • A Raspberry Pi 5 with its official USB-C power supply. The M.2 HAT+ can deliver up to 3 A to the SSD, so an undersized supply causes instability.
  • A Raspberry Pi M.2 HAT+ (standard version, takes 2230 and 2242 SSDs) or its Compact version (2230 only). The ribbon cable, spacers and 16 mm GPIO header come with the standard HAT+.
  • An M.2 M-key NVMe SSD in the 2230 or 2242 form factor. Note: the Samsung 990 PRO 4 To (4 TB) is a 2280 SSD. It does not fit the official M.2 HAT+, which only takes 2230 and 2242 drives. It could only work with a third-party M.2 adapter designed for 2280 drives, and its speed would still be limited by the Pi 5’s PCIe x1 link.
  • A microSD card (for example a SanDisk Extreme microSDXC A2 128 Go) with 64-bit Raspberry Pi OS Bookworm or later; the current release is based on Debian Trixie. The Pi 5 does not support Bullseye, and NOOBS has been discontinued. You use this card for the first boot, then keep it as a rescue card.
  • A monitor, keyboard and mouse if you use the Desktop edition. For the Lite edition, SSH access from your local network is enough.
  • Optional: the official Active Cooler, which works with the standard M.2 HAT+ (not with the Compact version).

Step-by-step installation

Step 1: Update the system and the bootloader

Boot the Pi from the microSD, before fitting the HAT, and update everything:

sudo apt update && sudo apt full-upgrade -y
sudo rpi-eeprom-update

Check: rpi-eeprom-update shows the bootloader date (CURRENT). According to the M.2 HAT+ documentation, it must be 6 December 2023 or later. If it is older, select sudo raspi-config → Advanced Options → Bootloader Version → Latest, then run:

sudo rpi-eeprom-update -a
sudo reboot

Step 2: Fit the M.2 HAT+ and the SSD

Shut the Pi down (sudo poweroff) and unplug the power supply. Then follow the official procedure:

  1. Fit the Active Cooler if you have one, then screw in the spacers.
  2. Press the 16 mm GPIO header onto the GPIO pins (the Compact version has none).
  3. Lift the latch on the Pi’s PCIe port and insert the ribbon cable with the metal contacts facing the USB ports, then push the latch back down.
  4. Place the HAT+ on the spacers and secure it. Insert the other end of the ribbon cable with the copper contacts facing up, then lock it.
  5. Unscrew the SSD retaining screw, slide the SSD in at a slight upward angle without forcing it, press it flat and screw it back in without overtightening.

Reconnect power and boot from the microSD.

Check:

ls -l /dev/nvme*
lsblk -o NAME,SIZE,MODEL,TYPE,MOUNTPOINTS

You should see /dev/nvme0 and /dev/nvme0n1, and lsblk should list the microSD (mmcblk0, mounted on / and /boot/firmware) as well as the SSD (nvme0n1). If nothing shows up, cut the power and check the ribbon cable’s orientation and latches.

Step 3: Put Raspberry Pi OS on the SSD

⚠️ Warning: both methods below erase everything on the SSD. Identify the right device first:

lsblk -o NAME,SIZE,MODEL,MOUNTPOINTS

The target must be nvme0n1, with your SSD’s size and model. Never choose mmcblk0, which is the microSD card you are currently running from.

Method A: clone the microSD with SD Card Copier (Desktop). Open Menu → Accessories → SD Card Copier. Pick the microSD as the source (Copy From Device) and the NVMe SSD as the target (Copy To Device). Tick New Partition UUIDs so the two drives don’t share the same identifiers, then click Start. Your current system is copied with its settings.

Method B: clean install with Raspberry Pi Imager. On the Pi (Desktop), install Imager if it is missing:

sudo apt install -y rpi-imager

Launch Raspberry Pi Imager. Choose Raspberry Pi 5 as the device, Raspberry Pi OS (64-bit) as the OS (or a Lite variant), and the NVMe SSD as the storage. Set the hostname, user and SSH in the customisation options, then write. You can also do this step from another computer, with the SSD in a USB M.2 NVMe enclosure.

Command-line variant (Lite, no desktop), after checking the target with lsblk:

wget -O raspios-lite-arm64.img.xz https://downloads.raspberrypi.com/raspios_lite_arm64_latest
xzcat raspios-lite-arm64.img.xz | sudo dd of=/dev/nvme0n1 bs=4M status=progress conv=fsync

With this variant, no customisation (user, SSH) is applied. Check your version’s documentation for how to configure the first boot, or use Imager instead.

Check:

sudo partprobe /dev/nvme0n1
lsblk -o NAME,SIZE,FSTYPE,LABEL /dev/nvme0n1

You should see two partitions: nvme0n1p1 as vfat (label bootfs) and nvme0n1p2 as ext4 (label rootfs). Raspberry Pi OS uses ext4 for the root filesystem. Keep it that way.

Step 4: Set the boot order in the EEPROM

Simple method (raspi-config):

sudo raspi-config

Select Advanced Options → Boot Order → NVMe/USB Boot, then Finish.

Explicit method (rpi-eeprom-config), recommended by the documentation for PCIe boot:

sudo rpi-eeprom-config --edit

In the editor, add or change the following line, then save:

[all]
BOOT_ORDER=0xf416

The value is read from right to left: 6 = NVMe, then 1 = SD card, then 4 = USB, then f = start again from the beginning. The official M.2 HAT+ follows the HAT+ specification and is detected automatically. The PCIE_PROBE=1 line is only needed for PCIe boards that don’t follow the HAT+ specification.

sudo reboot

The reboot applies the new EEPROM configuration. With no SD card inserted, the Pi boots from NVMe automatically, so you can also just remove the microSD after shutting the Pi down.

Step 5 (optional): PCIe Gen 3

By default the link runs at Gen 2.0 (5 GT/s). The documentation gives a 500 MB/s peak transfer rate for the HAT+. You can force Gen 3.0, but the Pi 5 is not certified for that speed and the connection may be unstable. To enable it, go to sudo raspi-config → Advanced Options → PCIe Speed, or add the following line to /boot/firmware/config.txt (on the boot partition of the system that actually boots):

[all]
dtparam=pciex1_gen=3

Then run sudo reboot. If you get I/O errors or crashes, remove the line. Nothing else needs to go into config.txt: the Pi 5 loads its 64-bit kernel (kernel_2712.img) automatically.

Verification checks

Check that the root filesystem is on the SSD and that the EEPROM is set correctly:

findmnt -n -o SOURCE /
findmnt -n -o SOURCE /boot/firmware
sudo rpi-eeprom-config | grep BOOT_ORDER
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS
df -h /

Expected results: /dev/nvme0n1p2 for /, /dev/nvme0n1p1 for /boot/firmware, BOOT_ORDER=0xf416, and a / size close to the SSD’s capacity. If you cloned with SD Card Copier and the partition doesn’t fill the whole drive, check your version’s documentation for how to expand it (for example sudo raspi-config → Advanced Options → Expand Filesystem if that option is there).

Read throughput and SSD health:

sudo apt install -y hdparm nvme-cli
sudo hdparm -t /dev/nvme0n1
sudo nvme smart-log /dev/nvme0n1

smart-log shows the temperature, the wear percentage (percentage_used) and media errors. The measured throughput is capped by the PCIe x1 link: a “PCIe 4.0 x4” SSD will never reach its advertised speeds here.

Security and best practices

  • Keep the microSD as a rescue card. Thanks to BOOT_ORDER=0xf416, if the SSD stops booting, the Pi will try the SD card.
  • Back up the data on the SSD to another drive. Moving to NVMe is not a substitute for backups.
  • Never expose SSH to the Internet. Restrict it to your local network or use a VPN (WireGuard, Tailscale). Use SSH keys and a strong password for your user.
  • Update regularly, both the system and the bootloader (sudo apt full-upgrade, sudo rpi-eeprom-update).
  • Always disconnect power before handling the ribbon cable or the SSD.
  • Watch the SSD temperature with nvme smart-log. A thin heatsink, if it physically fits with the HAT, can help under heavy load.

Troubleshooting common errors

The SSD doesn’t show up (no /dev/nvme*)

Cause: the ribbon cable is the wrong way round or not latched, the SSD isn’t seated properly, or the bootloader is too old. Fix: cut the power, reinsert the ribbon cable the right way round at both ends, then update the bootloader (step 1). For a non-HAT+ PCIe board, add dtparam=pciex1 to config.txt and PCIE_PROBE=1 to the EEPROM.

The Pi still boots from the microSD

Cause: the boot order tries the SD card first. Fix: set BOOT_ORDER=0xf416 (step 4) and reboot, or remove the microSD.

The SSD is detected but doesn’t appear in the file manager

Cause: a new SSD has no partition table or filesystem, and sudo blkid shows no partition UUID. Fix: write Raspberry Pi OS to it (step 3) or use Raspberry Pi Imager’s Erase option.

Random I/O errors or freezes

Cause: unstable PCIe Gen 3 mode, or an insufficient power supply. Fix: remove dtparam=pciex1_gen=3 and use the official power supply.

Boot fails after cloning without “New Partition UUIDs”

Cause: the SD card and the SSD have the same PARTUUIDs, so the system may mount the wrong partition. Fix: clone again with New Partition UUIDs ticked, or boot without the SD card.

FAQ

Do I need to edit config.txt to boot from NVMe?

No. The boot order is set in the EEPROM (rpi-eeprom-config or raspi-config). With the M.2 HAT+, you only need config.txt if you want PCIe Gen 3, which is optional and not certified.

Can I use an M.2 SATA SSD on the M.2 HAT+?

No. The M.2 HAT+ only supports M-key PCIe NVMe SSDs, in the 2230 and 2242 form factors (2230 only for the Compact version).

Is a 2280 SSD like the Samsung 990 PRO 4 To suitable?

Not with the official M.2 HAT+: it is too long. You would need a third-party adapter that takes 2280 drives. The PCIe x1 link would heavily limit its performance anyway.

Can I use F2FS or XFS for the root filesystem?

Raspberry Pi OS doesn’t support this without changes to the system (initramfs, cmdline). Keep ext4 for the root filesystem. You can, however, format an extra data partition with whatever filesystem you like.

Read also

Host this yourself

No hardware to manage? This kind of service runs on a managed VPS, ready in minutes. See PlanetHoster plans

Tags: raspberry pissd nvmeselfhostinghomelabboot ssd

Related

Tutorials

Create a Raspberry Pi 5 NAS in 2026: Complete Guide

Guide for 2026 to transform a Raspberry Pi 5 into a high-performance NAS. Step-by-step guide on case, NVMe SSD, Docker, Samba setup and security for reliable self-hosting.

Read
Tutorials

Metal Rack Assembly for Home Lab 2026: Step-by-Step Guide

Discover our comprehensive and detailed tutorial to install a metal rack in 2026. Follow our practical tips, complete configuration files, and exact commands.

Read
Tutorials

Build a TrueNAS SCALE NAS in DIY Style for 2026: A Comprehensive Guide

Build a DIY NAS on TrueNAS SCALE (Debian) in 2026: assembly in a Jonsbo N4 or Node 304, install drive, ZFS pool created in the web UI, SMB share, built-in Docker apps and hardening.

Read