JB Josef Burger
CZ | EN
All posts

5 min read

How to boot a Raspberry Pi 4 from an NVMe SSD

On a home server the microSD card is the weak point. Here is how to run a Raspberry Pi 4 without one - from the EEPROM update to writing the system onto the SSD.

The Raspberry Pi 4 is more than capable of handling small server projects. If you want to use it as a home server, however, the microSD card can quickly become a weak point. Running the operating system from an SSD provides much better performance and makes more sense for a device that is expected to run continuously.

The Raspberry Pi 4 can also boot directly from a USB storage device. With an NVMe SSD and a suitable USB or NVMe adapter, you can run the entire system without a microSD card.

This guide focuses specifically on preparing the Raspberry Pi 4, updating the required firmware, configuring USB boot, and finally writing the system to the SSD.

What you will need

For this setup, you will need a Raspberry Pi 4, a suitable power supply, and an SSD connected through USB or an NVMe adapter compatible with the Raspberry Pi.

In my case, I'm using a Raspberry Pi 4B with an NVMe SSD connected through an expansion board. You don't necessarily need the same SSD model - the important thing is that the Raspberry Pi can properly detect it through the USB interface.

At the beginning, you'll also need a microSD card. It is only there to boot the Raspberry Pi once and set up its bootloader - the system itself will be written to the SSD from your computer.

Start the system from the microSD card

Before we can boot from the SSD, we first need to get the Raspberry Pi running normally from the microSD card.

Install Raspberry Pi OS on the card and boot the Raspberry Pi. A console is all you need here, the desktop environment is not required - the SSD will be written from your computer.

Once the system has started, open a terminal and update the system:

sudo apt update
sudo apt full-upgrade

After the updates have finished, reboot the Raspberry Pi:

sudo reboot

Update the EEPROM and bootloader

On the Raspberry Pi 4, it's important to have an up-to-date firmware and EEPROM bootloader. The bootloader is responsible for deciding where the Raspberry Pi looks for an operating system during startup.

To check for and install available EEPROM updates, run:

sudo rpi-eeprom-update -d -a

If an update is installed, reboot the Raspberry Pi:

sudo reboot

After the reboot, the bootloader should be ready to work with USB storage.

On older Raspberry Pi OS installations, you may also come across the rpi-update command. It is generally not required for a standard system or firmware update. For USB booting, the important part is having a sufficiently recent EEPROM bootloader.

Configure USB boot

Now we can change the boot configuration.

Open the Raspberry Pi configuration utility:

sudo raspi-config

Find the bootloader and boot-order settings. The exact names of the menu items may vary slightly depending on the Raspberry Pi OS version.

Set USB Boot as the preferred boot source.

The goal is to make the Raspberry Pi look for the operating system on the connected USB storage device - in our case, the SSD.

Save the configuration and reboot the Raspberry Pi.

Write the system to the SSD

Changing the bootloader configuration isn't enough by itself. The SSD also needs to contain a bootable operating system.

Connect the SSD to your computer through the USB adapter. The procedure is the same on macOS and Linux.

Raspberry Pi Imager

The most convenient option is the official Raspberry Pi Imager, which is available for both macOS and Linux. In the application, select:

Before starting the write, it's worth opening the settings behind the gear icon and filling in the hostname, user, password, SSH and optionally Wi-Fi. The system will then come up ready to use on first boot, even with no monitor attached to the Raspberry Pi.

Or from the command line

If you prefer the terminal, write the image with dd. The downloaded image is usually compressed, so unpack it first:

xz -d raspios.img.xz

On Linux, check which device the SSD was assigned and write the image:

lsblk
sudo dd if=raspios.img of=/dev/sda bs=4M status=progress conv=fsync

On macOS, find the disk with diskutil and unmount it before writing:

diskutil list
diskutil unmountDisk /dev/disk4
sudo dd if=raspios.img of=/dev/rdisk4 bs=4m

The macOS version of dd prints no progress; press Ctrl-T to see the current status. Above all, double-check the target device - dd asks no questions and overwrites whatever you point it at.

The amount of time required will depend mainly on the size of the image and the speed of the interface.

First boot without the microSD card

Once the system has been written, shut down the Raspberry Pi:

sudo shutdown -h now

Remove the microSD card, disconnect the SSD from your computer and attach it to the Raspberry Pi.

Power the Raspberry Pi back on.

If the bootloader is configured correctly and the system was written successfully, the Raspberry Pi should now boot directly from the SSD instead of the microSD card.

At this point, the Raspberry Pi can operate without a memory card at all.

Verify that the system is running from the SSD

After logging back into the system, it's a good idea to verify where the operating system is actually running from.

One simple way is:

lsblk

You can also check the device used for the root filesystem:

findmnt /

The root filesystem should be located on the SSD rather than the original microSD card.

If the Raspberry Pi boots normally after removing the microSD card and the root filesystem is located on the SSD, everything is configured correctly.

Why use an SSD?

For basic Raspberry Pi projects, a microSD card may be perfectly adequate. Once the device starts acting as a server, however, the storage becomes much more important.

The advantage of an SSD isn't only higher sequential transfer speeds. It also provides much better responsiveness when the system is performing frequent reads and writes, working with databases, or handling a larger number of files.

The Raspberry Pi 4 can also take advantage of its USB 3.0 interface, making an SSD a significant upgrade over a typical microSD card.

The result is a small and relatively inexpensive computer that can comfortably serve as a home server while no longer relying on a microSD card as its primary system storage.

Raspberry Pi Home server Linux