Booting Raspberry Pi 5 from NVMe SSD

Running a Raspberry Pi 5 from a NVMe SSD has become a lot easier these days.
Warp Terminal

Looking to give your Raspberry Pi an SSD boost? The good news is that it is a lot easier to boot from NVMe SSD with Raspberry Pi 5.

Raspberry Pi OS has built-in tool that allow you to easily copy existing OS from the SD card on the SSD.

This way, you switch the existing operating system on to the SSD without changing anything. You have the same applications, same configuration, same everything.

In this tutorial, I'll share the steps I used to switch from SD card and boot from a NVMe SSD on my Raspberry Pi 5.

πŸ“‹
Screenshots in this tutorial are a bit poor as I recorded the entire procedure and then took screenshots from the video recording. Perhaps when I repeat this process again, I can take better quality screenshots. For now, please ignore this minor inconvenience.

What do you need?

Here are the accessories that you are going to need to follow this tutorial with your Raspberry Pi 5.

  • The tutorial uses Raspberry Pi as a desktop, so you'll need the usual accessories like keyboard, mouse, monitor etc.
  • You should have Raspberry Pi OS installed on a micro SD card.
  • Raspberry Pi 5 doesn't have a built-in NVMe SSD slot. You need an external plugin or device that gives you access to NVMe. I am using the Pironman 5 case which comes with NVMe slot among many other stuff. You can use this or a HAT with NVMe support.

Pironman 5 Case With Tower Cooler and Fan

This dope Raspberry Pi 5 case has a tower cooler and dual RGB fans to keep the device cool. It also extends your Pi 5 with M.2 SSD slot and 2 standard HDMI ports.

Explore Pironman 5

The official Raspberry Pi M.2 HAT will be the cheaper option here.

Raspberry Pi M.2 HAT+ (for Raspberry Pi 5)
Raspberry Pi M.2 HAT+ is an official M.2 connector accessory for the Raspberry Pi 5, supports the connection of M.2-format PCIe and NVMe devices to the PCIe FPC connector on Raspberry Pi 5.
🚧
Not all the NVMe SSDs will be compatible with M.2 HAT or case you are using. Please explore what brand and make of SSD is supported by the HAT/case before buying them.

Step 1: Format your SSD

First thing, plug in your SSD to the NVMe HAT and power on the Raspberry Pi.

Please ensure that Raspberry Pi can see the plugged-in SSD. Check it with the following command:

lsblk -f
Check SSD details in Raspberry Pi 5

As you can see, although my SSD is recognized, there are no details about it. That's because I have a brand new SSD and it didn't have any partitions on it.

If you are in the same situation, install Gparted first:

sudo apt install gparted

And then use it to create a new partition on the SSD.

Run Gparted. Make sure you have chosen the correct disk from the top right corner.

You can go with MSDOS when you see a screen like this:

Formatting SSD in Rasperry Pi 5

Next, click on the + sign on the top left to create a new partition and create a single partition of the entire disk size. You can choose Ext4 filesystem although it should not matter as your SSD will be formatted again during SD card copying. Click Apply and then press on the βœ”οΈ to confirm the changes.

Creating new partitions in Raspberry Pi 5

You can verify the partitions by running the lsblk -f command again.

Step 2: Copy the SD Card to SSD

Raspberry Pi has a built-in tool for copying the content of the SD card to the USB/SSD.

This makes things much more convenient as it will just duplicate the SD Card onto the SSD. This means that your current configurations, applications, everything will remain the same even when you are booting from the SSD. Now that's super, isn't it?

Open up the menu and go to Accessories->SD Card Copier.

SD Card Copier
βœ‹
I found the SD Card Copy tool buggy. It was not showing the option to start the copying for almost a minute.

In the Copy From Device, choose SD Card and in the Copy To Device, choose the SSD.

Click start and wait for the process to finish. It will take some to finish copying the data on the SSD.

Once the data is copied on the SSD, move on to the last stage of this process and that is to change the boot order.

Step 3: Change the boot order

In the terminal, run the following command:

sudo raspi-config

You'll see a terminal user interface like the image below and you have to use the arrow keys to select Advanced Options here and press the enter key.

Changing boot order in Raspberry Pi 5

In the next screen, select Boot Order.

Changing the boot order to boot from SSD in Raspberry Pi 5

You'll see a few options here. Choose the middle one that says 'NVMe/USB Boot' and press enter key.

Change the boot order to boot from NVMe and USB in Raspberry Pi 5

You'll see some output in the terminal and then the following screen notifying you that your boot order has been changed.

Boot order successfully changed in Raspberry Pi

When you press enter key on the last step, it will ask you to reboot your system. You can do that or continue your work.

Step 4: Booting from the NVMe SSD

If you reboot in your Pi 5, you'll be booting from the SSD and your SD Card will be mounted as an external disk with two partitions on it.

Still, if you want to ensure that it is actually booting from the SSD and not from the SD card, power off the Pi and take out the Micro SD Card. Turn on the Pi again and see if it boots as before.

Conclusion

Does SSD provide a performance benefit over SD Card? I don't know. I didn't do any benchmarking. I didn't notice faster boot time. Perhaps if there are any programs that do a lot of read and write on the disk could benefit from the SSD.

I think there is another way to boot the Pi from SSD. If the SSD can be connected to the regular computer (there are USB-based connectors) and then burn the Raspberry Pi OS image directly on the SSD. Not sure if the boot order needs to be changed or not. I'll try this method some other day and share my experience.

For now, enjoy the fact that you can easily switch to SSD from SD Card on your Raspberry Pi 5 device.

Please let me know if you have questions or suggestions on this topic.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.