SPI Flash module to boot the OS on SSD?

Hi,
I have an SBC Radxa rock-5c
I read on the forum that you can boot different devices:

  • You can place your operating system on a USB dongle or SATA SSD (sata --> USB 3.0 cable/controller attached to USB 3. 0 port)
  • You can place your operating system on emmc
  • You can place your operating system on microSDCARD
  • You can place your operating system on Nvme"

I’d like to boot the OS “rock-5c_bookworm_cli_b1.output.img” on a SATA SSD (sata --> USB 3.0 cable/controller attached to the USB 3.0 port) and according to Radxa you need the SPI Flash Module. Is this really necessary?

Is it possible to boot the SDD directly onto USB 3.0 without the SPI Flash module?

Thanks!

You need U-boot somewhere like SPI / EMMC or SD-Card. So you don’t need the SPI module if you use on of the other mentioned options to boot rootfs from additional storage options like NVMe or Sata

At the moment I am using a microSDHC with the ‘rock-5c_bookworm_cli_b1.img’ image, which I installed using the ‘dd’ command.
But as I have an old 120 GB SSD, I wanted to do the same operation by connecting it to a USB 3.0 port. But it does not work. I ask again, do I need the SPI module?
I would also like to know if the penta SATA HAT needs this module?
Do you think a microSDXC can be used instead of an SSD to run the OS reliably?

Thanks!

You can have the bootloader on SPI / EMMC or SD-card, those are your options. Then you can have the actual OS anywhere like SSD. This requires some tinkering to set the correct boot disk uuid in the boot variables. Easiest is to use SPI but you can permanently leave a sd card plugged in and use it to boot into Linux

I searched for info on the subject and found shell command lines such as “lsblk -f” or “ls -l /dev/disk/by-uuid/” and programs such as “u-boot-update”, but I didn’t investigate their use. I also noticed that the “rsetup” GUI offered the option of “Update SPI Bootloader”. I assume that the last option is for owners of the SPI Flash module. Is there any other way of doing this, and if so, is there a script that would allow you to tinker with it?
There’s a “rpi-clone” script under raspberrypi that does this very well.

Finally, after a few tests with the “lsblk -f”, “blkid /dev/…” and “fdisk -l” commands, the results are as follows.
I do not understand why there is the same UUID on the sda3 and mmcblk1p3 and also the same “Disk identifier:”.
SBC Radxa rock-5c booted on SD card and SSD connected to USB and I get this, see below:

/////////////
rock-5c:~$ lsblk -f
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sda
|-sda1 vfat FAT16 config 4F2E-FC80
|-sda2 vfat FAT16 efi 4F30-50A2
`-sda3 ext4 1.0 rootfs a59c0a30-df88-45a2-ad0e-3eb1711ff8a8

mmcblk1
|-mmcblk1p1 vfat FAT16 config 4F2E-FC80 15.9M 0% /config
|-mmcblk1p2 vfat FAT16 efi 4F30-50A2 299.8M 0% /boot/efi
`-mmcblk1p3 ext4 1.0 rootfs a59c0a30-df88-45a2-ad0e-3eb1711ff8a8 1.5G 73% /
zram0 [SWAP]

/////////////
rock-5c:~$ sudo blkid /dev/sda3
/dev/sda3: LABEL=“rootfs” UUID=“a59c0a30-df88-45a2-ad0e-3eb1711ff8a8” BLOCK_SIZE=“4096” TYPE=“ext4” PARTLABEL=“primary” PARTUUID=“5690d8bb-b470-4a26-958a-5c1135d8f1ef”

rock-5c:~$ sudo blkid /dev/mmcblk1p3
/dev/mmcblk1p3: LABEL=“rootfs” UUID=“a59c0a30-df88-45a2-ad0e-3eb1711ff8a8” BLOCK_SIZE=“4096” TYPE=“ext4” PARTLABEL=“primary” PARTUUID=“5690d8bb-b470-4a26-958a-5c1135d8f1ef”

/////////////
rock-5c:~$ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mmcblk1: 7.4 GiB, 7948206080 bytes, 15523840 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: 3B224E8F-6BA8-4923-AB39-B84CF5D0E668

Device Start End Sectors Size Type
/dev/mmcblk1p1 32768 65535 32768 16M Linux filesystem
/dev/mmcblk1p2 65536 679935 614400 300M Linux filesystem
/dev/mmcblk1p3 679936 15523806 14843871 7.1G Linux filesystem

Disk /dev/zram0: 3.88 GiB, 4162592768 bytes, 1016258 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: JC
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3B224E8F-6BA8-4923-AB39-B84CF5D0E668

Device Start End Sectors Size Type
/dev/sda1 32768 65535 32768 16M Linux filesystem
/dev/sda2 65536 679935 614400 300M Linux filesystem
/dev/sda3 679936 234440703 233760768 111.5G Linux filesystem

The UUID is the same because the partition was cloned. It is now up to you to change it and modify your /boot/something.txt (?) and /etc/fstab to boot from the partition that you want. The boot partitions efi and config should stay on the eMMC or the sd card.

Hi incognito,
A partition and a cloned disk ID, that’s really strange! Indeed, I had installed the operating system separately on an SD card and on an SSD disk from a laptop using the “dd” command.

In the /boot directory there is a file with the TXT extension “uEnv. txt”, see below:

rock-5c:~$ cat /boot/uEnv.txt
# uEnv.txt has been retired.
# Please use:
# rsetup command to confiure device overlays;
# sudo nano /etc/kernel/cmdline && sudo u-boot-update to update kernel arguments.

I am not familiar with this ‘u-boot-update’ command, but I wonder in which of these files, see below, I should replace the old UUID with the new UUID?

/boot/extlinux/extlinux.conf
/etc/fstab
/etc/kernel/cmdline
/proc/cmdline

We do not need to change the UUID in the “/proc/cmdline” file (this one is read-only).

rock-5c:/$ cat /proc/cmdline
root=UUID=a59c0a30-df88-45a2-ad0e-3eb1711ff8a8
console=ttyFIQ0,1500000n8 quiet splash loglevel=4 rw earlycon consoleblank=0 console=tty1 coherent_pool=2M irqchip. gicv3_pseudo_nmi=0 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1 androidboot.fwver=ddr-v1.16-9fffbe1e78,bl31-v1.45,uboot-17.09-32-8-07/02/2024

Sorry but I don’t know how to do this on a Radxa distro. I only know armbian and Joshua Riek’s Ubuntu, which have these files.

The UUID is the same on the SD card and SSD drive because they are copied from the same OS image.

An explanation of this issue can be found by following this link, see below:
https://www.linuxquestions.org/questions/linux-general-1/what-is-disk-identifier-740408/

Other explanations of how to change a disk’s “Disk Identifier” and PARTUUID can also be found by following these links, see below:
https://unix.stackexchange.com/questions/375548/what-is-uuid-partuuid-and-ptuuid
https://askubuntu.com/questions/1250224/how-to-change-partuuid

I recommend GParted (GUI) to change the UUID of the /dev/sda2 (vfat) partition.

But what is the specific program/script on Armbian that allows u-boot to be set up with the modified UUID or Disk Identifier?

Thanks for your help.

On armbian you just modify the fstab and armbianEnv.txt.

Hello everyone and thank you for your advice which helped me to investigate further.
Although I’m not very familiar with disk identifiers and partitions as well as with the boot loader (u-boot) on SD card, I finally found a solution to boot the operating system on SSD disk connected via USB3.0.

I recommend this site, follow the link below:

In fact, this guide is valid for a different SBC (rock-pi-4c-plus), but from the same brand as mine. I’ve adapted this guide for my SBC (rock-5c). It works very well. My aim was not to use an SPI flash module. I think if you dig a little deeper, you’ll be able to come up with your own solution. Otherwise, for those who hate DIY, they can turn to an SPI flash module (see my first post above), which I didn’t use in this assembly.

1 Like

For those interested in U-Boot instructions and bootloader stages.