# Orange Pi 5 - Boot from NVME

**URL:** https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457
**Category:** General Discussion
**Created:** [2 April 2023 11:33 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 "2023-04-02T11:33:47Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![dsouza](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ac91a4/32.png) [@dsouza](https://dietpi.com/forum/u/dsouza)
#### Post date: [14 April 2023 09:36 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/21 "2023-04-14T09:36:42Z")

</div>

Thanks. I just tested again. Indeed `dietpi-config` update and `write_uboot_platform_mtd` do the same thing. Some observations below:

1. Reboot in fact does not boot back from NVMe.
2. A power cycle did not work initially. I took three tentatives to achieve a successful boot from NVMe.
3. In a second test, it took 5 power cycles for the NVMe boot to work.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [14 April 2023 12:40 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/22 "2023-04-14T12:40:14Z")

</div>

if possible, flash the Orange Pi Debian image on a spare SD card and update firmware + SPI using Orange Pi config tool. This way you should get regular reboot functionality back.

---

<div class="post-metadata">

### Author: ![dsouza](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ac91a4/32.png) [@dsouza](https://dietpi.com/forum/u/dsouza)
#### Post date: [14 April 2023 13:59 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/23 "2023-04-14T13:59:06Z")

</div>

Coincidently I had just done this before reading your post! (but used Orange Pi Ubuntu Jammy Server image instead of Debian).

After manually erasing SPI and flashing it via `orangepi-config` from Orange Pi Ubuntu Server image, now dietpi is booting normally from NVMe (also reboot is working now).

Thanks!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [14 April 2023 15:49 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/24 "2023-04-14T15:49:10Z")

</div>

ok probably the U-Boot from Armbian we use is not working well. We need to have a look.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [15 April 2023 15:18 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/25 "2023-04-15T15:18:43Z")

</div>

Armbian uses the Radxa U-Boot sources for all RK3588 SBCs, which may be the problem: [build/rockchip-rk3588.conf at 40fa40ebaaa9d450033e6a1c7394028448dae2ee · armbian/build · GitHub](https://github.com/armbian/build/blob/40fa40ebaaa9d450033e6a1c7394028448dae2ee/config/sources/families/rockchip-rk3588.conf#L11)  
Orange Pi have their own sources which are also used by their own build scripts (which are an Armbian fork): [GitHub - orangepi-xunlong/u-boot-orangepi](https://github.com/orangepi-xunlong/u-boot-orangepi)

Since I’m not keen to compile it myself yet, checking for compiled binaries. But their website is currently down. Uff, and why is it all plain HTTP (no encryption, no authentication) 🤔.

---

<div class="post-metadata">

### Author: ![dsouza](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ac91a4/32.png) [@dsouza](https://dietpi.com/forum/u/dsouza)
#### Post date: [15 April 2023 16:39 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/26 "2023-04-15T16:39:17Z")

</div>

Just as reference, this is the original OrangePi 5 `/usr/lib/u-boot/platform_install.sh` file from the Ubuntu Jammy Server image:

> **/usr/lib/u-boot/platform\_install.sh**
>
> ```auto
> DIR=/usr/lib/linux-u-boot-legacy-orangepi5_1.1.4_arm64
> write_uboot_platform ()
> {
> if [[-f $1/rksd_loader.img]]; then
> dd if=$1/rksd_loader.img of=$2 seek=64 conv=notrunc status=none > /dev/null 2>&1;
> else
> if [[-f $1/u-boot.itb]]; then
> dd if=$1/idbloader.img of=$2 seek=64 conv=notrunc status=none > /dev/null 2>&1;
> dd if=$1/u-boot.itb of=$2 seek=16384 conv=notrunc status=none > /dev/null 2>&1;
> else
> if [[-f $1/uboot.img]]; then
> dd if=$1/idbloader.bin of=$2 seek=64 conv=notrunc status=none > /dev/null 2>&1;
> dd if=$1/uboot.img of=$2 seek=16384 conv=notrunc status=none > /dev/null 2>&1;
> dd if=$1/trust.bin of=$2 seek=24576 conv=notrunc status=none > /dev/null 2>&1;
> else
> echo "[write_uboot_platform]: Unsupported u-boot processing configuration!";
> exit 1;
> fi;
> fi;
> fi
> }
> write_uboot_platform_mtd ()
> {
> if [[-f $1/rkspi_loader.img]]; then
> dd if=$1/rkspi_loader.img of=$2 conv=notrunc status=none > /dev/null 2>&1;
> else
> echo "SPI u-boot image not found!";
> exit 1;
> fi
> }
> setup_write_uboot_platform ()
> {
> if grep -q "ubootpart" /proc/cmdline; then
> local tmp=$(cat /proc/cmdline);
> tmp="${tmp##*ubootpart=}";
> tmp="${tmp%% *}";
> [[-n $tmp]] && local part=$(findfs PARTUUID=$tmp 2>/dev/null);
> [[-n $part]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null);
> [[-n $dev]] && DEVICE="/dev/$dev";
> fi
> }
> 
> ```

The contents of the `/usr/lib/linux-u-boot-legacy-orangepi5_1.1.4_arm64` is as follows:

> **linux-u-boot-legacy-orangepi5\_1.1.4\_arm64**
>
> ```auto
> root@orangepi5:/# uname -a
> Linux orangepi5 5.10.110-rockchip-rk3588 #1.1.4 SMP Wed Mar 8 14:50:47 CST 2023 aarch64 aarch64 aarch64 GNU/Linux
> root@orangepi5:/# cd /usr/lib/linux-u-boot-legacy-orangepi5_1.1.4_arm64
> root@orangepi5:/usr/lib/linux-u-boot-legacy-orangepi5_1.1.4_arm64# ls -l
> total 18248
> -rw-rw-r-- 1 root root 292864 Mar 8 14:49 idbloader.img
> -rw-rw-r-- 1 root root 16777216 Mar 8 14:49 rkspi_loader.img
> -rw-rw-r-- 1 root root 1613312 Mar 8 14:49 u-boot.itb
> root@orangepi5:/usr/lib/linux-u-boot-legacy-orangepi5_1.1.4_arm64# shasum *
> 3226e017ff58278dcae1d25dff115c24dde83ddf idbloader.img
> ab0546224890f4b2e858941e263bd134298578de rkspi_loader.img
> 6af24326f11c194edceef24ec760af3a03a8114c u-boot.itb
> root@orangepi5:/usr/lib/linux-u-boot-legacy-orangepi5_1.1.4_arm64#
> 
> ```

I’ve create a tar.gz file with the above images and it is avaiable for download at:

[linux-u-boot-legacy-orangepi5\_1.1.4\_arm64.tar u-boot images](https://1drv.ms/u/s!AorfKe3ImcTd68dgRNZorDgVXiR3eQ?e=UkPNXZ) (password “opi5uboot”)

---

<div class="post-metadata">

### Author: ![djliquidice](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/bc79bd/32.png) [@djliquidice](https://dietpi.com/forum/u/djliquidice)
#### Post date: [21 June 2023 01:59 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/27 "2023-06-21T01:59:57Z")

</div>

Howdy folks! It seems that this issue has not been resolved. ☹

I recently installed DietPi on a fresh pair of Orange Pi 5Bs and they take up to 5 power cycles to boot from NMVE. 😭.

Is the only current solution to follow @Joulinar 's instructions above? ([Orange Pi 5 - Boot from NVME - #22 by Joulinar](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/22))

Thank you all for investing your time in this great operating system. \<3

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [21 June 2023 07:51 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/28 "2023-06-21T07:51:06Z")

</div>

You could try booting from the SD card to get your system up and running. Once the system is online, there should be an option to flash SPI/Bootloader in the configuration menu. Does anything change after that? If not, you will have to use the workaround via OrangePi Debian.

---

<div class="post-metadata">

### Author: ![Zen](https://dietpi.com/forum/user_avatar/dietpi.com/zen/32/4189_2.png) [@Zen](https://dietpi.com/forum/u/Zen)
#### Post date: [25 June 2023 07:45 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/29 "2023-06-25T07:45:44Z")

</div>

For me the most simple solution to get my orange pi boot from nvme :  
flash the micro sd card with armbian  
flash the nvme with armbian

sudo armbian config  
system and security settings  
install/update the boot loader on mtd flashen

after that you can flash you nvme with any os and boot from it

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [25 June 2023 08:55 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/30 "2023-06-25T08:55:44Z")

</div>

> [@Zen](#):
>
> flash the nvme with armbian

Just out of interest, what is the reason for flashing Armbian on the NVMe? For me, it was enough to flash the SD card with OrangePi Debian and update the bootloader.

---

<div class="post-metadata">

### Author: ![Zen](https://dietpi.com/forum/user_avatar/dietpi.com/zen/32/4189_2.png) [@Zen](https://dietpi.com/forum/u/Zen)
#### Post date: [25 June 2023 09:39 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/31 "2023-06-25T09:39:05Z")

</div>

i tried different os for the bootloader update, and it seemed they have different effect on system security settings.

---

<div class="post-metadata">

### Author: ![dsouza](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ac91a4/32.png) [@dsouza](https://dietpi.com/forum/u/dsouza)
#### Post date: [6 July 2023 13:54 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/32 "2023-07-06T13:54:16Z")

</div>

My experience is the same as @Joulinar [mentioned above](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/30).

I booted OrangePi Debian via SD card and updated the SPI bootloader (don’t recall the command I’ve used).

After this, I installed DietPi on NVMe and it is booting fine (without SSD). It works every reboot…

I believe the issue is the SPI bootloader image included in DietPi - you should not use DietPi to flash the SPI.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [6 July 2023 17:32 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/33 "2023-07-06T17:32:29Z")

</div>

> [@dsouza](#):
>
> I believe the issue is the SPI bootloader image included in DietPi

We don’t have/create own bootloader. I’m not 100% sure which one we use, but for sure @MichaIng know

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [6 July 2023 19:29 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/34 "2023-07-06T19:29:36Z")

</div>

Very strange that flashing the SPI from Armbian works and in our case not, as we do exactly the same in `dietpi-config` 🤔. The only reason I can think of is that Armbian’s APT repository is currently stuck since February for some reasons, while their images are shipped with more recent kernel and bootloader builds/packages. So probably the newer SPI U-Boot build works.

I’ll extract a DEB file from the current Armbian Orange Pi 5 image for testing.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [6 August 2023 23:04 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/35 "2023-08-06T23:04:07Z")

</div>

Orange Pi 5 systems will get a kernel and U-Boot update with next DietPi update, which should also enable NVMe support, after flashing the new bootloader binary to SPI via `dietpi-config` \> Advanced Settings \> Update SPI bootloader: [Orange Pi 5/ROCK 5B | Kernel update and migration by MichaIng · Pull Request #6532 · MichaIng/DietPi · GitHub](https://github.com/MichaIng/DietPi/pull/6532)

USB boot works fine afterwards, would be great if some could test it with NVMe. We should then add an entry in our documentation about this and a link from the download page.

New images with this kernel to test are available here: [Index of /downloads/images/testing](https://dietpi.com/downloads/images/testing/)

Another bonus is that this kernel should fully support the Orange Pi 5B as well, i.e. its onboard WiFi.

---

<div class="post-metadata">

### Author: ![b0a7](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/b/ac8455/32.png) [@b0a7](https://dietpi.com/forum/u/b0a7)
#### Post date: [29 June 2024 22:45 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/36 "2024-06-29T22:45:42Z")

</div>

Confirmed. I am able to boot Orange Pi 5+ from NVMe after updating SPI bootloader using DietPi v9.5.1

---

<div class="post-metadata">

### Author: ![Renoria](https://dietpi.com/forum/user_avatar/dietpi.com/renoria/32/8093_2.png) [@Renoria](https://dietpi.com/forum/u/Renoria)
#### Post date: [9 October 2024 06:03 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/37 "2024-10-09T06:03:12Z")

</div>

I recently got a Orange Pi 5, to get started I should just follow [How to install DietPi - DietPi.com Docs](https://dietpi.com/docs/install/) and then to boot from my NVMe M.2 I should just do `dietpi-config` \> “Advanced Options” \> “Update SPI bootloader”

I get remove my SD card after that? Anything else to keep in mind? Thanks in advance!

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [9 October 2024 08:30 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/38 "2024-10-09T08:30:35Z")

</div>

theoretically that’s how it should work

---

<div class="post-metadata">

### Author: ![helmer](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/87869e/32.png) [@helmer](https://dietpi.com/forum/u/helmer)
#### Post date: [11 October 2024 09:11 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/39 "2024-10-11T09:11:49Z")

</div>

Hello,  
today I got an update (apt upgrade) from Armbian Source - kernel and firmware. Now the OrangePi 5 (DietPi v9.7.1) won’t boot anymore.  
Message: “Gave up waiting for root file system device. Common problems: …” and  
“ALERT! UUID=(UUID of the NVME - /dev/nvme0n1p1) does not exist.”  
I think the NVME is no longer recognized.  
DietPi booted from an SD can access the NVME.  
Does anyone have any idea what I can do now?  
Thanks in advance!

---

<div class="post-metadata">

### Author: ![helmer](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/87869e/32.png) [@helmer](https://dietpi.com/forum/u/helmer)
#### Post date: [11 October 2024 09:16 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/40 "2024-10-11T09:16:12Z")

</div>

> [@Renoria](#):
>
> `dietpi-config` \> “Advanced Options” \> “Update SPI bootloader”

Addition: dietpi-config \> “Advanced Options” \> “Update SPI bootloader” does not exist in the menu - only “Update MMC bootloader : Flash current U-Boot to /dev/mmcblk1”

[Previous page](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457.md?page=1)

[Next page](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457.md?page=3)
