Argon40 sent me awesome cases for Raspberry Pi 5 to try out. Both Argon One V3 and Argon NEO 5 come with support for NVMe M.2 SSD drives, so I decided to give it a go. I already have a guide on how to boot from USB on Raspberry Pi 4 – so this little tutorial will serve me well. I write most of them to learn how to do it, and to have an easy-to-understand guide to look up later!
Let’s go!
Boot from NVMe M.2 SSD
To get started, you have to have a compatible SSD drive. If this is your first time, read this chapter to make sure you have the correct storage at hand. It’s easy to pick up the wrong SSD on Amazon – so let me quickly explain.
Shop carefully
M.2 is a connector type. It’s a hardware specification shared by NVMe (PCIe controller) and SATA-based solid-state drives. I have a Super6C cluster that uses six M.2 ports for SSDs, but as the board is made for Compute Module 4, it only supports SATA-based storage. If I were to install an NVMe-based M.2 SSD – they wouldn’t work.
To take advantage of the boot via PCIe port exclusive to Raspberry Pi 5 board, you need an M.2 NVMe drive – take a look at these listings on AmazonUK|AmazonUS to find compatible storage.
The next step is to understand the form factor. M.2 SSDs come with various storage capacities and sizes. The numbers like 2240 or 2280 refer to the physical footprint. M.2 SSD board is 22mm wide and comes with various lengths: 40/60/80mm which is noted with the corresponding footprint numbers 2240/2260/2280 etc.
Mystery sorted.
Raspberry Pi 5 boot from NVMe
I’m using Argon40 One V3 with M.2 NVMe support, but the process will work for other PCIe expansion boards. Your first steps are to enable the PCIe port and configure it to support Gen3. To do that, open your config.txt located on the boot partition
sudo nano /boot/firmware/config.txt
#old path
sudo nano /boot/config.txt
and add the following lines:
[all]
dtparam=nvme
dtparam=pciex1_gen=3
Reboot your Raspberry Pi 5 board and install M.2 NVMe storage now. Once done, you can confirm that the PCIe port is working correctly and you can detect the new hardware with:
lspci
#output
PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller 980
PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge
The terminal output should appear above with the orange line listing your newly installed storage. You can also check if the system sees the drive present with:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.7G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 29.2G 0 part /
nvme0n1 259:0 0 931.5G 0 disk
The next step is to format the drive and prepare the partition. We can do this with fdisk
:
sudo fdisk /dev/nvme0n1
#then use the commands below, if you want multiple partitions, remember to define the sizes of each new partition correctly
n - create new partition
p - primary partition
w - write (save changed)
When you run lsblk
again the table should look like this:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.7G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part /boot/firmware
└─mmcblk0p2 179:2 0 29.2G 0 part /
nvme0n1 259:0 0 931.5G 0 disk
└─nvme0n1p1 259:1 0 931.5G 0 part
The next step is to change the boot order. Use sudo raspi-config
to open the configuration menu and navigate to Advanced Options > Boot Order > NVMe /USB Boot
Don’t reboot your Raspberry Pi, just yet. We need to copy partitions over to your new drive. We can use dd
to achieve this with a single line of code:
sudo dd if=/dev/mmcblk0 of=/dev/nvme0n1 bs=4MB status=progress
Now you can reboot your Raspberry Pi 5.
If all went ok, on your next boot the board should be booting from M.2 NVMe SSD. You can confirm this by running:
lsblk
#output
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk0 179:0 0 29.7G 0 disk
├─mmcblk0p1 179:1 0 512M 0 part
└─mmcblk0p2 179:2 0 29.2G 0 part
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/firmware
└─nvme0n1p2 259:2 0 29.2G 0 part /
Final thoughts
Booting Raspberry Pi 5 from NVMe SSD is a piece of pie! it takes only a few minutes, and you can take advantage of reliable storage, fast file access and an incredibly swift boot! Let me know how you will use your Raspberry Pi 5 and the new storage in this Reddit thread. Also, what was the storage capacity you went for?
📈 – See the transparency note for details.