Boot a Raspberry Pi from NVMe or USB SSD
Update EEPROM firmware, configure boot order, clone your SD image, and verify performance booting a Pi 4 or Pi 5 from USB SSD or NVMe.
Before you start
- ▸Raspberry Pi 4, 400, or 5 with working microSD boot
- ▸USB 3.0 SSD enclosure (Pi 4) or M.2 NVMe HAT+ (Pi 5)
- ▸Stable 5 V / 3 A (Pi 4) or 5 V / 5 A (Pi 5) USB-C power supply
- ▸Internet access to download firmware updates via apt
Booting a Raspberry Pi from NVMe or a USB SSD instead of a microSD card is one of the highest-impact hardware changes you can make. SD cards are slow, wear out unpredictably, and corrupt under power loss. A cheap SATA SSD over USB 3.0 delivers 3–5× the sequential throughput; an NVMe drive on a Pi 5 (via its PCIe connector) pushes that further still. This guide covers the full path: updating the bootloader firmware, configuring boot order, copying your existing OS image, and verifying the result. Notes for Pi 4 (USB boot) and Pi 5 (NVMe boot) are included throughout.
Hardware Requirements
- Pi 4/400: Any USB 3.0–capable SSD or flash drive. USB 3.0 SATA enclosures (ASMedia or JMicron chipsets) are widely tested; avoid USB-to-SATA bridges using UAS-problematic chips like the JMS578 without quirks.
- Pi 5: An M.2 HAT or HAT+ (e.g., Raspberry Pi M.2 HAT+) plus any PCIe Gen 2/3 NVMe SSD. The Pi 5 also supports USB boot, but NVMe is the faster path.
- A working microSD card with Raspberry Pi OS (Bookworm, 64-bit recommended) to perform the update.
- A stable 5 V power supply—cheap supplies drop voltage under SSD spin-up and cause mysterious reboots.
Step 1: Update the EEPROM Firmware
The Raspberry Pi 4 and 5 store bootloader code in an onboard EEPROM. The default factory firmware often has an SD-only boot order. You need to update it before anything else.
Check current firmware version
sudo rpi-eeprom-update
Output shows the current and latest available versions. If they differ, run the update.
Switch to the latest stable release channel and update
sudo raspi-config
Navigate to Advanced Options → Bootloader Version → Latest, confirm, then exit. Alternatively, do it from the shell:
sudo rpi-eeprom-update -a
sudo reboot
After rebooting, confirm the new version is active:
vcgencmd bootloader_version
You should see a date of 2023 or later for Pi 4, or 2024+ for Pi 5.
Step 2: Configure Boot Order
The EEPROM holds a BOOT_ORDER hex value that controls which devices are tried in sequence. The digits are read right-to-left.
| Hex digit | Meaning |
|---|---|
| 0x1 | SD card |
| 0x4 | USB mass storage |
| 0x6 | NVMe (Pi 5 / PCIe) |
| 0xf | Restart loop |
Edit the bootloader config
sudo -E rpi-eeprom-config --edit
This opens the current config in your default editor. Find or add the BOOT_ORDER line.
Pi 4 – USB SSD first, fall back to SD:
BOOT_ORDER=0xf41
Pi 5 – NVMe first, fall back to USB, then SD:
BOOT_ORDER=0xf461
Save and exit. The tool writes a new EEPROM image. Apply it and reboot:
sudo reboot
The Pi will flash the new config on the next boot. After it comes back up, verify:
vcgencmd bootloader_config | grep BOOT_ORDER
Step 3: Copy the OS to the SSD
You have two paths: clone the running SD card directly onto the SSD, or flash a fresh image. Cloning is convenient; a fresh install is cleaner and avoids carrying over any SD-specific tweaks.
Option A – Clone with rpi-clone
rpi-clone is the de-facto tool for this. Install it:
sudo apt update && sudo apt install -y git
git clone https://github.com/billw2/rpi-clone.git
cd rpi-clone && sudo cp rpi-clone /usr/local/sbin/
Identify your SSD device (it will appear as /dev/sda for USB, or /dev/nvme0n1 for NVMe):
lsblk
Clone to the SSD (replace sda with your device name):
sudo rpi-clone sda
For NVMe:
sudo rpi-clone nvme0n1
The tool partitions the SSD, copies all data, and updates /etc/fstab and /boot references automatically. It takes 5–20 minutes depending on how full your SD card is.
Option B – Flash a fresh image
Use the Raspberry Pi Imager on a separate computer to write Raspberry Pi OS directly to the SSD connected via USB. Select Choose OS → Raspberry Pi OS (64-bit), then select your SSD as the storage target.
Step 4: Pi 5 NVMe — Enable PCIe and Set Generation
On the Pi 5, the NVMe HAT connects to the single-lane PCIe port. By default the port is enabled but runs at Gen 2. Many SSDs benefit from explicitly declaring the generation in /boot/firmware/config.txt.
Enable PCIe (required if not already present)
echo 'dtparam=pciex1' | sudo tee -a /boot/firmware/config.txt
Optionally force Gen 3 (experimental, some SSDs require Gen 2)
echo 'dtparam=pciex1_gen=3' | sudo tee -a /boot/firmware/config.txt
Gen 3 is not officially supported by the Pi 5 SoC but works reliably with many drives. If you see NVMe errors in dmesg, remove this line and stick with Gen 2.
Step 5: First Boot from SSD
Remove the microSD card, connect the SSD (USB enclosure or NVMe HAT), and power on. The green activity LED will blink as normal during boot. If the Pi fails to boot and you left the SD card out, the LED pattern indicates the error code—three blinks means no bootable OS found.
Once booted, confirm you are running from the SSD:
findmnt /
The SOURCE column should show /dev/sda2 or /dev/nvme0n1p2, not /dev/mmcblk0p2.
lsblk -o NAME,MODEL,TRAN,SIZE,MOUNTPOINT
This shows the transport type (usb or nvme) alongside device names so you can confirm immediately.
Step 6: Benchmark and Verify Performance
Run a quick I/O test to confirm you are actually getting SSD-class throughput:
sudo apt install -y hdparm
sudo hdparm -tT /dev/sda # USB SSD
# or
sudo hdparm -tT /dev/nvme0n1 # NVMe
Typical results: a USB 3.0 SATA SSD reads at 300–400 MB/s buffered; a Gen 2 NVMe on Pi 5 hits 800–900 MB/s. Compare to a Class 10 SD card at 20–45 MB/s to appreciate the difference.
For a more thorough test including write performance and latency:
sudo apt install -y fio
fio --name=seq-read --rw=read --bs=1M --size=512M --filename=/tmp/fiotest --direct=1
Troubleshooting
Pi won't boot at all (three green LED blinks)
The bootloader found no valid OS. Check that the SSD is partitioned correctly and the first partition is a FAT32 boot partition containing start4.elf (Pi 4) or start.elf (Pi 5). Re-seat the SD card and verify the EEPROM boot order was applied correctly with vcgencmd bootloader_config.
USB SSD drops off the bus / random reboots
This is almost always a power issue or a UAS-related bug with the USB bridge chipset. First, try a powered USB hub or a better PSU. Second, check the chipset:
lsusb -t
If you have a known-problematic chipset (JMS578, Realtek RTL9210 in some modes), add a usb-storage.quirks entry to /boot/firmware/cmdline.txt. The Raspberry Pi forums maintain an up-to-date quirks list per chipset ID.
NVMe not detected on Pi 5
Confirm the HAT is seated firmly and dtparam=pciex1 is in /boot/firmware/config.txt. Run dmesg | grep -i nvme to see whether the kernel found the device. Some SSDs with aggressive power management need nvme_core.default_ps_max_latency_us=0 appended to cmdline.txt.
PARTUUID mismatch after cloning
If you cloned manually (e.g., with dd) and the Pi hangs on "Waiting for root filesystem", the PARTUUID in /boot/firmware/cmdline.txt and /etc/fstab still points to the SD card's UUID. Find the new UUID:
sudo blkid /dev/sda2
Update cmdline.txt and fstab on the SSD's boot partition to match, then reboot.
Frequently asked questions
- Do I need to keep the SD card in after setting up USB/NVMe boot?
- No. Once the SSD has a valid OS and the EEPROM boot order is configured to try USB or NVMe first, the Pi will boot entirely from the SSD. The SD card is only needed if you want a fallback.
- Will any USB enclosure work with the Pi 4?
- Most modern enclosures work, but some USB-to-SATA bridge chips (notably certain JMS578 revisions) have UAS bugs that cause disconnects under load. Check the Raspberry Pi forums for known-good chipsets, or disable UAS with a usb-storage.quirks kernel parameter.
- Is Gen 3 NVMe safe on the Pi 5?
- It works with many drives but is not officially supported by Raspberry Pi. Gen 2 is stable and officially tested. Try Gen 3 for the throughput gain, but revert to Gen 2 if you see NVMe errors in dmesg.
- Can I still boot from SD in an emergency after these changes?
- Yes. If your BOOT_ORDER includes 0x1 (SD card) anywhere in the sequence, and you insert a bootable SD card while the SSD is absent or broken, the Pi will fall back to it automatically.
- Does this work with Raspberry Pi OS Lite or only the desktop version?
- It works with all variants: Lite, Desktop, and the full recommended image. The bootloader and EEPROM configuration are independent of which OS flavor you install on the SSD.
Related guides
Back Up Linux with Borg or restic
Set up encrypted, deduplicated backups with BorgBackup or restic: local and remote repos, retention pruning, restoring files, and systemd timer scheduling.
How to Check Disk Health with SMART
Learn to use smartctl to read SMART attributes, run drive self-tests, and identify early warning signs of HDD and SSD failure before data loss occurs.
Debug systemd Units that Won't Start
Learn a repeatable workflow to debug systemd services that won't start: status output, journalctl, systemd-analyze verify, and safe override.conf patches.
Linux Server Disaster Recovery Checklist
A practical Linux server disaster recovery checklist: what to back up, RTO/RPO planning, immutable off-site copies, automated restore drills, and verification.