Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: Unable to Boot from NVME on Orange Pi 5 v 3.2 #1140

Open
tim273 opened this issue Dec 9, 2024 · 5 comments
Open

Bug Report: Unable to Boot from NVME on Orange Pi 5 v 3.2 #1140

tim273 opened this issue Dec 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@tim273
Copy link

tim273 commented Dec 9, 2024

What happened?

Trying to boot from NVME, I followed the commands on the wiki

sudo u-boot-install-mtd
sudo ubuntu-rockchip-install /dev/nvme0n1

Then when I run fdisk -l I see this:

Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5F83A195-5CAC-4127-B7DC-6CAC436E1235

Device           Start   End Sectors  Size Type
/dev/mtdblock0p1    64  7167    7104  3.5M Linux filesystem
/dev/mtdblock0p2  7168  7679     512  256K Linux filesystem
/dev/mtdblock0p3  7680  8063     384  192K Linux filesystem
/dev/mtdblock0p4  8064  8127      64   32K Linux filesystem
/dev/mtdblock0p5  8128  8191      64   32K Linux filesystem
/dev/mtdblock0p6  8192 16383    8192    4M Linux filesystem
/dev/mtdblock0p7 16384 32734   16351    8M Linux filesystem


Disk /dev/mmcblk1: 117.75 GiB, 126437294080 bytes, 246947840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 92F34E70-349D-43DB-B27D-C0F3FBFFB4B2

Device         Start       End   Sectors   Size Type
/dev/mmcblk1p1 32768     40959      8192     4M Microsoft basic data
/dev/mmcblk1p2 40960 246947806 246906847 117.7G EFI System


Disk /dev/nvme0n1: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: KBG50ZNS256G NVMe KIOXIA 256GB          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2A50CF80-2A7E-4154-A385-1E7E47964961

Device         Start       End   Sectors   Size Type
/dev/nvme0n1p1 32768     40959      8192     4M Microsoft basic data
/dev/nvme0n1p2 40960 500117503 500076544 238.5G EFI System

I power off, remove the microSD card and nothing. Then when I put the microSD card back again and run fdisk -l the NVME drive disappears:

Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5F83A195-5CAC-4127-B7DC-6CAC436E1235

Device           Start   End Sectors  Size Type
/dev/mtdblock0p1    64  7167    7104  3.5M Linux filesystem
/dev/mtdblock0p2  7168  7679     512  256K Linux filesystem
/dev/mtdblock0p3  7680  8063     384  192K Linux filesystem
/dev/mtdblock0p4  8064  8127      64   32K Linux filesystem
/dev/mtdblock0p5  8128  8191      64   32K Linux filesystem
/dev/mtdblock0p6  8192 16383    8192    4M Linux filesystem
/dev/mtdblock0p7 16384 32734   16351    8M Linux filesystem


Disk /dev/mmcblk1: 117.75 GiB, 126437294080 bytes, 246947840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 92F34E70-349D-43DB-B27D-C0F3FBFFB4B2

Device         Start       End   Sectors   Size Type
/dev/mmcblk1p1 32768     40959      8192     4M Microsoft basic data
/dev/mmcblk1p2 40960 246947806 246906847 117.7G EFI System

ubuntu@ubuntu:~$ ls /dev/nvme*
ls: cannot access '/dev/nvme*': No such file or directory

Sometimes it's there after this, but sometimes it's not. But if it's not there and I use parted to remove all the partitions on mtdblock0 and boot with the microSD card, it appears again.

Kernel version

6.1.0-1025-rockchip

SBC model

Orange Pi 5

What operating system are you seeing this problem on?

Ubuntu 24.04 LTS (Noble Nombat)

Relevant logs

No response

@tim273 tim273 added the bug Something isn't working label Dec 9, 2024
@Deiiji
Copy link

Deiiji commented Dec 12, 2024

Hello.
After mtd erase and write to it, download image, decompress and use dd to write to nvme. If regular way don't work, ths one will do

@AaronNGray
Copy link

I booted from SDCard, then fdisked, then made an ext4 partition, downloaded the image, then use Ubuntu Image Writer by clicking on the download in file manager, then chose the NVMe ext4 partition then wrote to that.

@ewaldc
Copy link

ewaldc commented Dec 22, 2024

@tim273,
ubuntu-rockchip-install is a bash script located in /usr/bin. Hence you can fully trace how it works by executing it as sudo bash -x ubuntu-rockchip-install /dev/nvme0n1.

The parts that seems strange are those Microsoft basic data partitions at mmcblk1p1 and /dev/nvme0n1p1. Normally the EFI System partition (containing an ext4 file system) should be the first partition. Could it be that your SD card was not fully formatted and erased? Also, when you log into the OS that is on de SD card and execute fdisk -l you should always see the NVME drive if it is properly connected and there are no short circuits (e.g. the heatsink on the NVME touching the board somehow). Also, you might be running a very old u-boot version. Try updating u-boot using the command /usr/bin/u-boot-install /dev/mmcblk0 from the OS on the SD card. This will flash the latest u-boot, one that understands how to scan the PCI bus and look for NVME devices.

If you are familiar with bash, then the script is easy to read. Essentially you first configure the OS on the SD card and the script just clones the (installed and configured) OS as-is to EMMC or NVME via rsysnc. At the very end, it creates the boot entries for u-boot to find, using the command line chroot ${mount_point}/desktop-rootfs/u-boot-update >/dev/null 2>&1. Everything else is determined by u-boot and it's (default) boot sequence, that is: sd card first, then emmc and finally NVME.

@tim273
Copy link
Author

tim273 commented Dec 22, 2024

Thanks for the comments from everyone. For whatever reason, I couldn't get it to work, so I tried Armbian instead and used armbian-config to do the same thing and it worked. I'm now able to boot Armbian from the NVME drive. What I noticed is that I tried using the commands detailed in the wiki for booting to the NVME on a couple of existing Orange Pi 5's that I had it worked for both of them. Those were older models that purchased about a year ago and had put multiple other OS's on them also booting from the NVME.

However, this time I tried it with a brand new Orange Pi 5 and no dice. Then it worked with Armbian, so I'm not sure what is going on.

But thank you all again for your help!

@AaronNGray
Copy link

AaronNGray commented Dec 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants