---
title: "How to boot Radxa Rock 5B from an NVMe SSD"
url: "https://blog.sf-paris.dev/en/how-to-boot-radxa-rock-5b-from-nvme-ssd/"
lang: "en"
translations:
  it: "https://blog.sf-paris.dev/come-avviare-radxa-rock-5b-da-ssd-nvme/"
author: "Simone Flavio Paris"
published: "2024-04-04T16:30:36+00:00"
updated: "2024-04-04T17:07:17+00:00"
categories:
  - "From my bench"
tags:
  - "boot"
  - "nvme"
  - "PCIe"
  - "radxa"
  - "rockchip"
  - "ssd"
summary: "A step-by-step guide to booting the Radxa ROCK 5B from an M.2 NVMe SSD: which SPI bootloader image to choose, how to verify the checksums and how to clear and flash the SPI NOR flash with dd."
reading_time_minutes: 3
word_count: 654
---

# How to boot Radxa Rock 5B from an NVMe SSD

April 4, 2024

![Radxa ROCK 5 Model B spec infographic: Rockchip RK3588, up to 16GB RAM, PCIe 3.0 x4 NVMe slot, 8K video, WiFi 6E, 2.5GbE](https://blog.sf-paris.dev/wp-content/uploads/2023/08/rock5b.avif)

The tech community has seen a surge of single-board computers (SBCs) over the past few years, offering tech enthusiasts a plethora of options. However, few come as power-packed and future-ready as the Radxa **ROCK 5 Model B**. This potent Raspberry Pi alternative brings to the table a set of features that puts it a notch above many of its competitors.

Historically, the default choices for booting operating systems on such devices have been either through a microSD card or embedded MultiMediaCard (eMMC) memory. While both methods have served their purpose, they come with their own sets of limitations, primarily in terms of speed and overall system responsiveness. Enter the NVMe (Non-Volatile Memory Express) drives, a game-changer in the world of storage solutions, known for their breathtaking speed and efficiency.

The PCIe 3.0 x4 slot on the ROCK 5B isn't just a token feature; it represents a paradigm shift. By leveraging the capability to connect NVMe drives directly to this slot, users can bypass the traditional bottlenecks associated with microSD cards and eMMC memory. The potential benefits?

- Faster boot times,
- snappier system responses, and
- a smoother user experience.

For those yearning to unlock this potential and revolutionize their SBC experience, the question isn't about "why" but "how." How does one transition from conventional storage methods to booting their operating system straight from an NVMe drive on the ROCK 5B? The upcoming guide promises to shed light on this transformative journey, offering step-by-step insights to supercharge your ROCK 5B experience.

## Download the needed files

Let's start by downloading the needed files, working from a system already booted from microSD or eMMC on the board: **[zero.img](https://dl.radxa.com/rock5/sw/images/others/zero.img.gz)** and the new **bootloader.img**, needed since we are going to flash it to the SPI NOR flash.  
  
There are 4 different bootloader images (the versions marked \[old\] are still the latest ones Radxa publishes):

- [normal bootloader](https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-gd1cf491-20240523.img) \[[old](https://web.archive.org/web/20240309093949/https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-gbf47e81-20230607.img)\], recommended for everything **except Armbian**, has the U-Boot serial console disabled
- [bootloader for Armbian](https://github.com/huazi-yg/rock5b/releases/download/rock5b/rkspi_loader.img), if you want to boot Armbian from the M.2 NVMe SSD
- [debugging bootloader](https://dl.radxa.com/rock5/sw/images/loader/rock-5b/debug/rock-5b-spi-image-gd1cf491-20240523-debug.img) \[[old](https://web.archive.org/web/20240521002840/https://dl.radxa.com/rock5/sw/images/loader/rock-5b/debug/rock-5b-spi-image-gbf47e81-20230607-debug.img)\] with U-Boot serial console enabled, if you need to troubleshoot booting issues over the serial console (for advanced users).
- [EDK2 bootloader](https://github.com/edk2-porting/edk2-rk3588/releases) for booting UEFI-compatible operating system images (**currently experimental**)

You can download files by using *`wget link.to/file.img`*. In this guide I'm using the first one.

```
mkdir bootloader
cd bootloader/
wget https://dl.radxa.com/rock5/sw/images/others/zero.img.gz
wget https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-gd1cf491-20240523.img
```

We are going to decompress the file and check that the MD5 digest is the same as the one published on the Radxa website.

```
gzip -d zero.img.gz
md5sum zero.img
```

The result of the above command will be something like this: *`2c7ab85a893283e98c931e9511add182 zero.img`*

```
md5sum rock-5b-spi-image-gd1cf491-20240523.img
```

*`cf53d06b3bfaaf51bbb6f25896da4b3a rock-5b-spi-image-gd1cf491-20240523.img`*

Here are the checksums of the other possible files:

```
2c7ab85a893283e98c931e9511add182  zero.img
cf53d06b3bfaaf51bbb6f25896da4b3a  rock-5b-spi-image-gd1cf491-20240523.img
fa14c99718f55b66e82aa1661e43c1ec  rock-5b-spi-image-gd1cf491-20240523-debug.img
bd21a6459ad33b8189782e4c904d99b3  rock-5b-spi-image-gbf47e81-20230607.img
1b83982a5979008b4407552152732156  rkspi_loader.img
```

If everything is okay, we can move on to checking whether the SPI flash is available:

```
ls /dev/mtdblock*
```

It will return the device: *`/dev/mtdblock0`*

## Let's flash the bootloader

The first step is to completely clear the SPI flash: *(be patient: flashing can take up to 5 mins; in my case it took 3 mins)*

```
sudo dd if=zero.img of=/dev/mtdblock0
```

Check whether the flash was successfully cleared:

```
sudo md5sum /dev/mtdblock0 zero.img
```

*`2c7ab85a893283e98c931e9511add182 /dev/mtdblock02c7ab85a893283e98c931e9511add182 zero.img`*

Okay! Now you can write the desired bootloader to the SPI flash using the following command:

```
sudo dd if=rock-5b-spi-image-gd1cf491-20240523.img of=/dev/mtdblock0
```

Be patient, it will take some time again; as soon as it has finished, you can run

```
sync
```

and then check again if everything was successful:

```
sudo md5sum /dev/mtdblock0 rock-5b-spi-image-gd1cf491-20240523.img
```

`cf53d06b3bfaaf51bbb6f25896da4b3a /dev/mtdblock0cf53d06b3bfaaf51bbb6f25896da4b3a rock-5b-spi-image-gd1cf491-20240523.img`In my case the two digests are identical, which means that everything went well; otherwise, **flash the bootloader again**.

To put the system on the SSD, download the image from Radxa’s download page and write it with `sudo xzcat /home/radxa/rock-5b_xx.img.xz | sudo dd of=/dev/nvme0n1 bs=1M status=progress`, replacing the file name with yours and checking the name after `of=` twice: if you pick the wrong device, you lose the data on it.

Now you can safely reboot your device!

Simone Flavio Paris

Simone Flavio Paris is an AI Engineer and co-founder of Rinoova. He works full time as a Full-stack Software Engineer on a SaaS platform in Java and Angular; with Rinoova he builds SaaS products with LLM agents and runs the infrastructure they live on, including self-hosted LLMs on GPU. He holds a degree in data science with honours and the Google Associate Cloud Engineer certification. He lives in Rome, Italy.
