Booting The Raspberry Pi 5 With An NVMe SSD

The Raspberry Pi has come a long way since its humble origins, adding faster processors and better interfaces with each new generation. Now, the Raspberry Pi 5 has a lovely new PCIe port right on board, and [Jeff Geerling] has gone right ahead and slammed in an NVMe SSD as a boot drive.

[Jeff] explains that to use an NVMe to boot, you first have to modify /boot/config.txt to enable PCIe and modify the Raspberry Pi’s boot order. Once the bootloader is appropriately configured, you can boot straight off an SSD with Raspberry Pi OS installed. To get the operating system on to an NVMe drive, he recommends cloning an existing boot volume from a microSD install.

One of the primary reasons you might want to do this is speed. NVMe drives are generally a significant cut above even the best microSD cards, both in speed and reliability. [Jeff] also notes that you can use an NVMe SSD through a PCIe switch on the Pi 5 if you so desire, but you can’t currently boot with this configuration.

It’s a great feature to have on the Pi 5, and it follows on from the earlier implementation on the Raspberry Pi Compute Module 4. Video after the break.

27 thoughts on “Booting The Raspberry Pi 5 With An NVMe SSD

  1. > One of the primary reasons you might want to do this is speed
    For me the primary reason would be to avoid SDcard corruption, it doesn’t happen that often, but when it does it’s always a hassle to get that specific Pi working again. Second reason would be cost, no more loss of SDcards andSSD’s are cheaper per GB. Speed would come last in my book, but perhaps with the Pi 5 i would run applications that require greater I/O speed, though I can’t envision at the moment what those would be.

    1. You should not use RW filesystems for anything other than logs and configs (and only those supposed to be changed during runtime) in an embedded device and even then it should be a special filesystem with wear leveling.
      Not doing so either means that you have a very niche use-case or (much more probably) means serious malpractice.

      1. I think a lot of us use them for development platforms though. I use mine as a portable Arduiino development environment. I connected it to a small UPS board to avoid the SD corruption problems and I’m going to move to the automotive/industrial SD cards as mentioned below.

    2. I just use industrial grade sd cards. They’re not that much more expensive and they include all the error correction and wear leveling you’d expect from an SSD. But for a Pi5 I do think a speed boost beyond an sd card’s capabilities is very welcome.

    3. I have Pi-like devices that never get turned off and have run for years with whatever SD-card was on the best sale that day years ago at Best Buy. Corruption has not been a problem. I don’t think that’s the best reason to switch to NVME.

      I do realize that SD cards are probably going to be more prone to corruption from hardware errors. But I doubt that’s the reason the majority of people who experience corruption on a Pi do so. Instead I think it is because people forget that their Raspberry Pis are just computers running the same software as a Linux desktop, not mere dumb appliances. They pull the power without a proper shutdown.

      Any modern operating system is constantly doing housekeeping stuff in the background. Files are being accessed and altered. When the device loses power in the middle of altering a file.. there are mechanisms to give it a chance to recover but it’s always a possibility that something important is lost. Do this once… the odds are in your favor. Do it on a regular basis… it’s only a matter of time before failure.

      One solution is to mount your filesystem read-only, as @Grawp has mentioned. For a lot of embedded applications this is no doubt a fine solution.

      Sometimes you really want write access though. For example… Octoprint. I want to integrate my Octoprint box with my 3d printer and make them one device. I want to turn it on and off with a simple flick of the switch. But I also want to be able to upload gcode to the device and save it there. I want to be able to run updates and download plugins. And I want to do these things without having to get to a terminal and remount the filesystem.

      The solution to that is battery backup. You don’t need much of a battery. The idea is to use one of the GPIOs to sense when power is cut and initiate a proper shutdown. The battery is only meant to keep it going long enough to do that. In fact, if you have some money to spend on this you can do it with super capacitors. Then there is no battery to replace.

      So sure, if you need to squeeze that last bit of industrial reliability out of your Pi an NVME might be good for that. So might @Casplantje’s industrial grade SD cards. But if you are still subjecting them to improper shutdowns you are rolling the dice every time. And if you are not.. it’s probably already reliable enough.

      Still a cool ability. I’m sure that NVME runs a lot faster!

    4. I would think people want nvme so they can have their own mini Kubernetes development platform. I do it now with Virtual box, but it sounds more fun on a pi. If you are doing a lot of service mesh lab work at home its a decent option.

  2. I don’t mean to be a troll but I always assumed RPi based systems were for more “embedded” type applications where certain amount of GPIO driving and hardware interfacing is to be expected.

    If someone is using these systems as normal Linux servers, wouldn’t something like Intel NUC or similar small form factor PCs be better?

    1. For most people yes an x86 system would be better. You’d go for ARM if you have a specific reason to, personally that’s power consumption, noise and ‘cool toy’ factor.

      1. And availability, didn’t Intel just EOL the NUC range?

        I have a feeling the price comparison will lean in favour of the Pi 5 but perhaps not by a huge percentage though I’m happy to be corrected on that as I admit I’ve not done the comparison yet.

        1. Intel ended up selling the NUC line to Asus. More importantly the likely reason they decided to get out of that space is that a slew of cheap competitors cropped up. You can get an x86 mini computer brand new for less than $150 any day and under $100 if you bargain hunt. Sure that’s more than a Pi 5 but if you factor in a case and SSD it’s close enough to say they are in the same market. And the mini pc will have a performance advantage.

      2. For a home user, second-hand thin clients are cheaper, faster, and lower power than a RP5. And that’s before adding that they have a nice case, and are x86. Not so high on the ‘cool toy ‘ factor though.

        1. It really depends what you’re doing, it’s real easy to forget that the majority of home users just don’t give a damn how stuff works, what it is, how much RAM, SSD, GPU etc, they just want it to work.

          IIt’s only us, the tiny minority of geeks who bicker about this stuff.

          1. right. I run Octopi on my Pi because it’s effortless. Could I save $20 by using XYZ and installing my own software? Sure but I don’t feel like it. My printer is a tool and the Pi is a tool for my tool.

    2. Having HDMI on board and decent to good video capabilities (depending on the model) turned the RPi into a very convenient alternative to commercial media players. Then one day Covid + war + chip scarcity happened and, as with a lot of other products, RPi prices skyrocketed to a point people who wouldn’t strictly need a board that small or with many GPIOs would look for alternatives. However there are also performance reasons; an unlocked used Chromebox one year ago cost a lot less than an used RPi, and they run circles around it in performance. Today prices arent’ that extreme, still there are many alternatives, including the embedded field in which the Raspberry dominance has been eroded by cheaper and more powerful/advanced boards.

    3. That is true for me… An “embedded” type in the since I buy RPIs for mostly headless use and for the GPIO. Have desktops, servers, and laptops for any other use.

      RPIs and Picos are for fun ‘projects’. So why gaming and video performance is a ‘concern’ I have no idea :) .

  3. I never understood why the RPIs lacks SPI boot flash (or most other ARM SBC, though some have empty footprints you can use).

    Benefits:
    – You no longer need an SD card for booting, and can use network storage or SDDs for the operating system
    – You could boot a generic image on the PI, without a need of a different image for each SBC type

    AFAICS, at least all the RISCV64 boards available get this right, and its how it works on any PC.

    1. Since Pi4 there is SPI boot flash. However it did not help with any of your points – point 1 (booting from usb, network) was already possible before with existing boot ROM, point 2 depends on what you mean – either it works from day 1 – same sd card can boot in any Pi model, or it still does not work if you mean really generic solutionout of box or there is UEFI for Pi3,4 that can boot generic arm linux or even windows 10/11 if you feel this is the way.

    2. > You no longer need an SD card for booting

      USB boot with a 120 GB SSD works at least on my Raspi 3 that I use for PiHole and IOBroker. Of course it’s not superfast, but it does it’s job very reliable. That’s all I expect of a small, cheap, headless, GUI-less network-device (that’s what a RasPi is for me, still).

  4. 0xF14 setting for EEPROM on Raspberry Pi 4B performed by the utility raspi-config. Booting from a USB 3.0 Case (Ugreen NVMe M.2 Case to USB 3.0 interface, 1050MB per second MAX transfer speed) or ( SATA SSD drive 2.5″ inch 560MB per second MAX transfer speed) I enjoy using a 240GB Kingston SSD 2.5″ drive as a desktop and watching youtube videos on my 42″ inch LCD TV with HDMI audio speakers is a nice experience to watch Jeff Gerling Videos on the big screen. Do look at https://freebsd.org/where for a 14.0-Release arm64 SnapShot image to write to USB Flash Drive Stick or to a microSD card. https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/14.0/FreeBSD-14.0-RC2-arm64-aarch64-RPI.img.xz FreeBSD is ROCK SOLID STABLE running on a Raspberry Pi 4B. Give it a test run from a snapshot image written to a USB flash drive or microSD card.

    1. You get 1050MB/s on a 6Gbps usb3 connection? Cool story bro.
      I didn’t think the rpi4 had the internal bus bandwidth to max out the usb3 interface, but you seem to get more speed than the physical hardware runs at

  5. Am I the only one curious why a co processor/southbridge needs x4 lanes of PCIe? Does the RP1 have all the USB3 and Ethernet/WiFi going through it? And if so, why not some SATA as well, or does that really saturate x4, or would x2 suffice and we could have a couple more for faster SSD/ 2.5GbE/GPU

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.