# 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:** 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: [11 October 2024 09:19 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/41 "2024-10-11T09:19:06Z")

</div>

I will ask our developer. @MichaIng 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: [11 October 2024 12:54 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/42 "2024-10-11T12:54:21Z")

</div>

I took down the latest kernel package from from our APT servers.

@helmer  
Which kernel version does the system on the SD card have? The previous or the new one?

Can you check whether really none of the two expected SPI devices exist?

```sh
ls -l /dev/mtdblock0 /dev/mtd0

```

And in case the SD card still runs the old kernel, can you upgrade to the new one and check whether the NVMe device `/dev/nvme0n1p1` is still accessible?

EDIT: Maybe this one is related, where it seems with the new kernel, the NVMe drive is not detected at all: [OPI 5+ 16GB random fails with NVMe - Orange Pi 5 Plus - Armbian Community Forums](https://forum.armbian.com/topic/45507-opi-5-16gb-random-fails-with-nvme/)

---

<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 14:04 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/43 "2024-10-11T14:04:37Z")

</div>

> [@MichaIng](#):
>
> `ls -l /dev/mtdblock0 /dev/mtd0`

Thanks for the quick response!

The new kernel is on the SD card:  
“Linux DietPi 6.1.75-vendor-rk35xx #1 SMP Wed Oct 9 05:12:23 UTC 2024 aarch64 GNU/Linux”

I recreated the SD card today.  
This means that access to the NVME is possible after mounting /dev/nvme0n1p1.

```auto
/dev/mmcblk1p1/boot:
lrwxrwxrwx 1 root root 28 Oct 11 06:46 Image -> vmlinuz-6.1.75-vendor-rk35xx

/dev/nvme0n1p1/media/boot:
lrwxrwxrwx 1 root root 28 Oct 11 05:47 Image -> vmlinuz-6.1.75-vendor-rk35xx

root@DietPi:/# ls -l /dev/mtdblock0 /dev/mtd0
crw------- 1 root root 90, 0 Oct 11 13:53 /dev/mtd0
brw-rw---- 1 root disk 31, 0 Oct 11 13:53 /dev/mtdblock0

```

Therefore I don’t think that the NVME is not recognized. When starting, the kernel is loaded from the NVME. After that, however, access to the root partition is not possible.

```auto
root@DietPi:/# dmesg |grep nvme
[13.855308] nvme nvme0: pci function 0004:41:00.0
[13.855357] nvme 0004:41:00.0: enabling device (0000 -> 0002)
[13.871666] nvme nvme0: missing or invalid SUBNQN field.
[13.897784] nvme nvme0: allocated 128 MiB host memory buffer.
[13.907261] nvme nvme0: 8/0/0 default/read/poll queues [13.911893] nvme0n1: p1 [3030.505174] EXT4-fs (nvme0n1p1): mounted filesystem with ordered data mode. Quota mode: none.

```

```auto
root@DietPi:/# lsblk 
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS 
sda 8:0 0 1.8T 0 disk 
└─sda1 8:1 0 1.8T 0 part 
mtdblock0 31:0 0 16M 0 disk 
mmcblk1 179:0 0 59.7G 0 disk 
└─mmc blk1p1 179:1 0 59.7G 0 part / 
nvme0n1 259:0 0 476.9G 0 disk 
└─nvme0n1p1 259:1 0 476.9G 0 part /media

```

---

<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 14:20 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/44 "2024-10-11T14:20:23Z")

</div>

> [@helmer](#):
>
> ls -l /dev/mtdblock0 /dev/mtd0

```auto
root@DietPi:/usr/lib/linux-u-boot-vendor-orangepi5# lspci -k
0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01)
Kernel driver in use: pcieport
0004:41:00.0 Non-Volatile memory controller: Kingston Technology Company, Inc. OM3PDP3 NVMe SSD (rev 01)
Subsystem: Kingston Technology Company, Inc. OM3PDP3 NVMe SSD
Kernel driver in use: nvme

```

---

<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: [11 October 2024 14:23 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/45 "2024-10-11T14:23:04Z")

</div>

About the SPI devices: And in `dietpi-config` “Update SPI bootloader” does still not show up 🤔. Can you show this:

```sh
cat /usr/lib/u-boot/platform_install.sh

```

EDIT: Ah, found it already. The script changed a little. Will fix it for upcoming release.

About NVMe boot: The kernel etc are loaded from the NVMe, obviously, but this is done by the bootloader, which comes with its own drivers etc. But the kernel itself, or the init system, then does not find the device anymore. Actually I think it is the kernel.

Can you compare the `/boot/dietpiEnv.txt` `rootdev` entry (on the NVMe) with the actual UUID of the NVMe drive?

```sh
lsblk -o NAME,UUID /dev/nvme0n1

```

---

<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 14:30 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/46 "2024-10-11T14:30:38Z")

</div>

```auto
root@DietPi:~# cat /usr/lib/u-boot/platform_install.sh
DIR=/usr/lib/linux-u-boot-vendor-orangepi5
write_uboot_platform () 
{ 
    local logging_prelude="";
    [[$(type -t run_host_command_logged) == function]] && logging_prelude="run_host_command_logged";
    if [[-f $1/rksd_loader.img]]; then
        ${logging_prelude} dd if=$1/rksd_loader.img of=$2 seek=64 conv=notrunc status=none;
    else
        if [[-f $1/u-boot.itb]]; then
            ${logging_prelude} dd if=$1/idbloader.img of=$2 seek=64 conv=notrunc status=none;
            ${logging_prelude} dd if=$1/u-boot.itb of=$2 seek=16384 conv=notrunc status=none;
        else
            if [[-f $1/uboot.img]]; then
                ${logging_prelude} dd if=$1/idbloader.bin of=$2 seek=64 conv=notrunc status=none;
                ${logging_prelude} dd if=$1/uboot.img of=$2 seek=16384 conv=notrunc status=none;
                ${logging_prelude} dd if=$1/trust.bin of=$2 seek=24576 conv=notrunc status=none;
            else
                echo "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
}

```

```auto
root@DietPi:~# lsblk -o NAME,UUID /dev/nvme0n1
NAME UUID
nvme0n1     
└─nvme0n1p1 15710500-2fe4-40f8-9579-50060014a118

root@DietPi:~# cat /media/boot/dietpiEnv.txt |grep rootdev
rootdev=UUID=15710500-2fe4-40f8-9579-50060014a118

```

---

<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 14:33 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/47 "2024-10-11T14:33:45Z")

</div>

How can I go back to the old kernel?  
The following files are in the /boot directory:

```auto
root@DietPi:/media/boot# ls -la
total 61860
drwxr-xr-x 4 root root 4096 Oct 11 05:47 .
drwxr-xr-x 18 root root 4096 Aug 26 02:16 ..
-rw-r--r-- 1 root root 0 Oct 11 05:47 .next
lrwxrwxrwx 1 root root 28 Oct 11 05:47 Image -> vmlinuz-6.1.75-vendor-rk35xx
-rw-r--r-- 1 root root 7371614 Oct 9 10:37 System.map-6.1.75-vendor-rk35xx
-rw-r--r-- 1 root root 2692 Jun 10 19:20 boot.cmd
-rw-r--r-- 1 root root 2764 Jun 10 19:24 boot.scr
-rw-r--r-- 1 root root 244742 Oct 9 10:37 config-6.1.75-vendor-rk35xx
drwxr-xr-x 4 root root 4096 Aug 26 02:16 dietpi
-rw-r--r-- 1 root root 18092 Jun 9 20:54 dietpi-LICENSE.txt
-rw-r--r-- 1 root root 16109 Jun 9 20:54 dietpi-README.md
-rw------- 1 root root 3950 Jan 1 2021 dietpi-wifi.txt
-rw-r--r-- 1 root root 17869 Jul 4 12:58 dietpi.txt
-rw-r--r-- 1 root root 302 Jul 8 06:30 dietpiEnv.txt
lrwxrwxrwx 1 root root 24 Oct 11 05:47 dtb -> dtb-6.1.75-vendor-rk35xx
drwxr-xr-x 3 root root 4096 Oct 11 05:47 dtb-6.1.75-vendor-rk35xx
-rw-r--r-- 1 root root 8240416 Oct 11 05:47 initrd.img-6.1.75-vendor-rk35xx
lrwxrwxrwx 1 root root 28 Oct 11 05:47 uInitrd -> uInitrd-6.1.75-vendor-rk35xx
-rw-r--r-- 1 root root 8240480 Oct 11 05:47 uInitrd-6.1.75-vendor-rk35xx
-rw-r--r-- 1 root root 39152128 Oct 9 10:37 vmlinuz-6.1.75-vendor-rk35xx

```

---

<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: [11 October 2024 14:54 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/48 "2024-10-11T14:54:20Z")

</div>

First of all, to fix the SPI bootloader update option:

```sh
apt install patch
cd /boot
curl -sSf 'https://github.com/MichaIng/DietPi/commit/64af7e9.patch' | patch -p1
dietpi-config

```

Please test whether this helps, just to rule it out. If not, to downgrade the kernel on the NVMe system mounted to `/media` on the SD card system:

```sh
cd /tmp
apt update
apt download linux-{image,dtb}-vendor-rk35xx
dpkg -i --root=/media linux-*.deb

```

---

<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 17:29 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/49 "2024-10-11T17:29:15Z")

</div>

Sorry for the late reply.

Update SPI bootloader : Flash current U-Boot to /dev/mtdblock0 does not work. The kernel is not loaded - no boot screen.

I tried it twice. The system seems to be dead.

Booting from the SD card, the kernel download does not work:

```auto
root@DietPi:/tmp# apt download linux-{image,dtb}-vendor-rk35xx
E: Can't find a source to download version '24.11.0-trunk-dietpi1' of 'linux-dtb-vendor-rk35xx:arm64'
E: Can't find a source to download version '24.11.0-trunk-dietpi1' of 'linux-image-vendor-rk35xx:arm64'

```

---

<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: [11 October 2024 17:48 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/50 "2024-10-11T17:48:52Z")

</div>

Both needs to be done from the SD card system, of course. Did you run an `apt update` before `apt download ...`?

---

<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 18:17 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/51 "2024-10-11T18:17:23Z")

</div>

Yes - both after booting from the SD card. Before that, of course, do “apt update”.

---

<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 18:19 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/52 "2024-10-11T18:19:56Z")

</div>

```auto
root@DietPi:/tmp# cat /etc/apt/sources.list
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
and

```

---

<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 18:21 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/53 "2024-10-11T18:21:06Z")

</div>

new try:

```auto
root@DietPi:/tmp# cat /etc/apt/sources.list
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb https://deb. debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware 
deb https://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware

```

---

<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: [11 October 2024 19:00 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/54 "2024-10-11T19:00:52Z")

</div>

Simply put it into a `code` block

---

<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: [11 October 2024 19:18 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/55 "2024-10-11T19:18:56Z")

</div>

Please just retry. I just needed to refresh the repository anyway, it should work now.

---

<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: [12 October 2024 03:44 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/56 "2024-10-12T03:44:21Z")

</div>

Thank you very much for your support!  
I did the following:

```auto
root@DietPi:~# mount /dev/nvme0n1p1 /media
mount: (hint) your fstab has been modified, but systemd still uses
the old version; use 'systemctl daemon-reload' to reload.

root@DietPi:~# systemctl daemon-reload

 root@DietPi:~# ls /media/
bin boot dev etc home lib lost+found media mnt opt ​​proc root run sbin srv sys tmp usr var 

root@DietPi:~# cd /tmp

root@DietPi:/tmp# ls

root@DietPi:/tmp# apt update
Hit:1 https://deb.debian.org/debian bookworm InRelease
Hit:2 https://deb.debian.org/debian bookworm-updates InRelease
Hit:3 https://dietpi.com/apt bookworm InRelease
Hit:4 https://dietpi.com/apt all InRelease
Hit:5 https://deb.debian.org/debian-security bookworm-security InRelease
Hit:6 https://deb.debian.org/debian bookworm-backports InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

root@DietPi:/tmp# apt download linux-{image,dtb}-vendor-rk35xx
E: Can't find a source to download version '24.11.0-trunk-dietpi1' of 'linux-dtb-vendor-rk35xx:arm64'
E: Can't find a source to download version '24.11.0-trunk-dietpi1' of 'linux-image-vendor-rk35xx:arm64'

```

Can I download the files manually?

I’m driving all day today, so I won’t be able to look further until tomorrow - maybe this evening.

---

<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: [12 October 2024 16:41 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/57 "2024-10-12T16:41:44Z")

</div>

WTH, can you try this:

```sh
curl -sSf https://dietpi.com/apt/dists/all/orangepi5/binary-arm64/Packages | grep Version:

```

---

<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: [13 October 2024 04:11 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/58 "2024-10-13T04:11:13Z")

</div>

Good morning!  
Here is the output of the command:

```auto
root@DietPi:/tmp# curl -sSf https://dietpi.com/apt/dists/all/orangepi5/binary-arm64/Packages | grep Version:
Version: 24.5.0-trunk
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk-dietpi1
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk-dietpi1
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk-dietpi1
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk
Version: 24.8.0-trunk-dietpi1
Version: 24.5.0-trunk-dietpi1
Version: 24.8.0-trunk-dietpi1
Version: 24.8.0-trunk-dietpi1
Version: 24.8.0-trunk-dietpi1

```

---

<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: [13 October 2024 10:49 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/59 "2024-10-13T10:49:50Z")

</div>

I tried something else. I found the image of Dietpi on my PC from the beginning of July 2024. I used it to create a new SD card and boot without Ethernet.  
Then I ran dietpi-config \> “Advanced Options” \> “Update SPI bootloader”.  
Then the OrangePi 5 boots from the NVME again and then gives up again.  
After “apt update” I ran “apt download linux-{image,dtb}-vendor-rk35xx”. Result:

```auto
Get:1 https://dietpi.com/apt all/orangepi5 arm64 linux-dtb-vendor-rk35xx arm64 24.8.0-trunk-dietpi1 [2036 kB]
Get:2 https://dietpi.com/apt all/orangepi5 arm64 linux-image-vendor-rk35xx arm64 24.8.0-trunk-dietpi1 [30.6 MB]
Fetched 32.7 MB in 4s (8259 kB/s)

```

"root@DietPi:/tmp# dpkg -i --root=/media linux-_.dtb" then doesn’t work - message:  
dpkg: error: cannot access archive 'linux-_.dtb’: No such file or directory

Then I tried: “dpkg -i --root=/media linux-\*.deb”.  
Result:  
“dpkg: unrecoverable fatal error, aborting: unknown system group ‘messagebus’ in statoverride file; the system group got removed before the override, which is most probably a packaging bug, to recover you can remove the override manually with dpkg-statoverride”

Now I’m unsure what to do.

---

<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: [13 October 2024 13:14 UTC](https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457/60 "2024-10-13T13:14:25Z")

</div>

So the package list did not contain the 25.11.0 version anymore. Then I have no idea why APT tried to download it. Maybe cleaning the lists would have helped:

```sh
/boot/dietpi/func/dietpi-set_software apt clean

```

Oh right, `.deb` file extension of course.

About the error, maybe `dpkg` with `--root` given checks statoverrides on the host but users in the defined root. I would consider this a `dpkg` but. Can you check:

```sh
cat /var/lib/dpkg/statoverride
cat /media/var/lib/dpkg/statoverride
grep messagebus /etc/passwd /media/etc/passwd

```

And this this work?

```sh
cd /tmp
export DPKG_ROOT='/media'
dpkg -i --root=/media linux-*.deb
unset DPKG_ROOT

```

Else, ugly but should work:

```sh
cp -a /var/lib/dpkg/statoverride /var/lib/dpkg/statoverride.bak
dpkg-statoverride --remove /usr/lib/dbus-1.0/dbus-daemon-launch-helper
dpkg -i --root=/media linux-*.deb
mv /var/lib/dpkg/statoverride.bak /var/lib/dpkg/statoverride

```

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

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