Skip to content

Install Raspberry Pi OS on M.2 NVMe SSD on Raspberry Pi 5

I recently had to install Raspberry Pi OS on an M.2 NVMe SSD in my Raspberry Pi 5. This was not as straight-forward as I would have liked it to be (as you can’t boot from USB and install directly per se).

There seems to be three main ways to do this, but they all have the same goal; load the Raspberry Pi OS onto the NVMe SSD.

  1. Boot from Raspberry Pi OS on bootable USB stick, and then install Raspberry Pi OS onto NVMe SSD via rpi-imager
  2. Install Raspberry Pi OS on SD-card, boot the Raspberry Pi, and then install Raspberry Pi OS onto NVMe SSD via rpi-imager
  3. Install the NVMe SSD into existing computer, and load Raspberry Pi OS onto it.

Out of these, I chose alternative number 2, as I had plenty of SD-cards laying around. The rest of this guide assumes you’ve already installed the NVMe drive into the Raspberry Pi 5, and that the end-result will be that we have installed a non-desktop Raspberry Pi OS 64-bit onto the NVMe drive. Change accordingly if you’re using any other OS.

Create bootable SD-card

First step is to download the Rasperry Pi Imager on your computer. This can be downloaded here. Once downloaded, choose the “Raspberry Pi 5” as the device, “Raspberry Pi OS (other)” then “Raspberry Pi OS Lite (64-bit)“. Choose the SD-card, and write it to the SD-card. Once done, install the SD-card into the Raspberry Pi 5 with the NVMe SSD.

Update OS and install requirements

Once you boot the Raspberry Pi 5 from the SD-card, you need to set your username and password. Once that is done, we can start preparing for the installation.

First we need to download the image we’re writing to the NVMe drive. For Raspberry Pi OS, the latest versions can be found here.

# download latest rpi-os lite 64-bit
wget https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2025-05-13/2025-05-13-raspios-bookworm-arm64-lite.img.xz

Then we need to update OS/packages, the firmware/bootloader, and install requirements:

# update OS/packages
apt update
apt full-upgrade

# update firmware/bootloader
# answer yes to any questions
rpi-update

# reboot the rpi
reboot

# install requirements
apt update
apt install -y rpi-imager libglx0 libopengl0 libegl1 libgl1-mesa-glx

# list nvme device
root@raspberrypi:~# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk0     179:0    0 238.3G  0 disk
|-mmcblk0p1 179:1    0   512M  0 part /boot/firmware
`-mmcblk0p2 179:2    0 237.8G  0 part /
nvme0n1     259:0    0 476.9G  0 disk

# install image onto nvme
rpi-imager --cli 2025-05-13-raspios-bookworm-arm64-lite.img.xz /dev/nvme0n1

Boot from NVMe

At this point, you can shut down the Raspbbery Pi, remove the SD-card, and start the Raspberry Pi again. It should now boot from the NVMe.

Disable NetworkManager and use ifupdown

Personally I dislike NetworkManager, especially for headless server-esque setups. I prefer to use ifupdown, and in a few easy steps, we can revert to this:

# install ifupdown
apt update
apt install -y ifupdown

# disable NetworkManager
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
systemctl mask NetworkManager.service

# edit/create config
vim /etc/network/interfaces

# edit resolv.conf (previously managed by NetworkManager)
vim /etc/resolv.conf

# reboot the rpi
reboot
Leave a Reply

Your email address will not be published. Required fields are marked *