Prepare the NVMe drive as the boot disk and configure the machine so it can be managed remotely from the start.
After reboot, SSH should work and `findmnt /` should show the NVMe-backed root filesystem.
Step-by-step
Install the M.2 HAT+ and NVMe drive
Power the Pi off completely. Install the M.2 HAT+ or compatible adapter according to its hardware instructions, secure the NVMe drive, and reconnect the PCIe ribbon carefully.
Flash Raspberry Pi OS
Use Raspberry Pi Imager on another computer. For a headless server, Raspberry Pi OS Lite 64-bit is a good choice. Select the NVMe device as the destination if your adapter is connected to the computer, or prepare it from a temporary Pi installation.
Preconfigure hostname and login
In Imager customization, set a hostname such as pi-web, create a non-default username, set a strong password, configure your time zone, and enable SSH. Prefer an SSH public key when you are comfortable using one.
Boot from the NVMe drive
Insert or connect the NVMe device and start the Pi. Raspberry Pi 5 can boot from NVMe when the bootloader and boot order are configured appropriately. If an SD card is still inserted, it may be tried first depending on boot order.
Verify the root filesystem is on NVMe
After logging in, use lsblk and findmnt to confirm that the running root filesystem is on the NVMe device, not an SD card.
lsblk
findmnt /
Update the operating system
Install current package updates before adding server software.
sudo apt update
sudo apt full-upgrade -y
sudo reboot
After reboot, SSH should work and `findmnt /` should show the NVMe-backed root filesystem.
Troubleshooting
If the Pi will not boot from NVMe, temporarily boot from SD, update the bootloader, and check the boot order rather than repeatedly re-imaging the drive.
What you learned
You now understand the purpose of this part of the system and have a concrete result you can verify before continuing to the next lesson.