RPI4 boot from USB SSD with aarch64 2021-11 edition

This is for ARMv8 based devices

RPI4 boot from USB SSD with aarch64 2021-11 edition

Postby jfabernathy » Mon Nov 29, 2021 2:03 pm

Now that I have Arch 64bit running from a SD card on a RPI4, I want to see about booting from a USB3 SSD. I have one of the adapters that boots fine on Raspbian from the same RPI4 which has all the latest bootloader firmware.

I see from my searches that this topic goes back a number of years with different solutions. Has it been documented somewhere what the best process is to get Archlinux to boot from only a USB3 SATA SSD?
Last edited by jfabernathy on Tue Nov 30, 2021 5:32 pm, edited 1 time in total.
jfabernathy
 
Posts: 30
Joined: Mon Jan 14, 2019 7:36 pm

Re: RPI4 boot from USB SSD with aarch64

Postby jfabernathy » Tue Nov 30, 2021 12:25 pm

Based on past experience with embedded Linux, I'm trying some stuff. Probably wrong, but here's what I found.

If I follow the instructions for RPI4 64 bit Archlinux ARM I substituted my USB3 SSD for the SDcard. So on my Archlinux latptop I had my USB SSD appear as /dev/sdb and I used that instead of mmcblk0.

I followed the instructions except that in modifying the root/etc/fstab, I use /dev/sda1 instead of /dev/mmcblk1p1.

So plugging in just the USB3 SSD with no SDcard, It booted the system to the point that it's trying to mount the rootfs.

What I see on the screen is:
$this->bbcode_second_pass_code('', 'Waiting 10 seconds for device /dev/disk/by-partuuid/daa92289-02 ...
ERROR device 'PARTUUID=daa92289-02' not found. Skipping fsck.')

on my laptop I see this for the blkid information:
$this->bbcode_second_pass_code('', 'blkid /dev/sdb
/dev/sdb: PTUUID="daa92289" PTTYPE="dos"')

So it knows which partition UUID is the rootfs, but can't find it. Any ideas what has to change in the boot.txt or somewhere else? Is the DOS partition type a problem?
jfabernathy
 
Posts: 30
Joined: Mon Jan 14, 2019 7:36 pm

Re: RPI4 boot from USB SSD with aarch64

Postby jfabernathy » Tue Nov 30, 2021 2:37 pm

No matter whether I use UUID or /dev/sda1 or 2 I get the same problem. The boot process can't mount rootfs.

I've found a post from way back that says:
$this->bbcode_second_pass_code('', 'I managed to boot the official aarch64 rootfs on raspberry pi4 from external SSD without a custom kernel.
To do that I had to:
1) Manually update uboot-raspberrypi to the latest RC (2020.10rc2) to fix "No USB Controller Found" error in U-boot
2) Add pcie_brcmstb into MODULES in /etc/mkinitcpio.conf
3) Rebuild initrd with mkinitcpio -P')

I figure step #1 is not relevant in 2021.11
I can add pcie_brcmstb into the MODULES in /etc/mkinitcpio.conf, but how do I do the step #3?

running mkinitcpio -P assumes a lot. Normally in Archlinux install on x86 it's run while you have arch-chroot /mnt and rootfs is /mnt and boot in mounted under root in boot/efi

So if step #3 is the right solution how do you accomplish it??
jfabernathy
 
Posts: 30
Joined: Mon Jan 14, 2019 7:36 pm

Re: RPI4 boot from USB SSD with aarch64

Postby jfabernathy » Tue Nov 30, 2021 5:31 pm

It's always the assumptions that get you!

Here is a workaround that I did to get my RPI4 to boot aarch64 from USB3 SSD without an SD card inserted.

From a freshly built RPI4 running archlinuxarm 64 bit from an SD Card, I did the following:

1. Plug in the USB3 adapter with the SATA SSD attached. (do this after booted or it will not be recognized)
2. Follow the instructions at https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4 except for the part about the fstab. In this case you will simple want to edit root/etc/fstab and change the device from mmcblk0p1 to sda1. Mine looks like /dev/sda1 instead of /dev/mmcblk0p1
3. The only boot directory file that needs changing are the initrd files.
4. On the booted RPI4 from the SDcard, modify /etc/mkinitcpio.conf and add pcie_brcmstb into MODULES and save.
4.1 Also make the same change to root/etc/mkinitcpio.conf so any rebuilds done during system upgrades will work.
5. Run $this->bbcode_second_pass_code('', 'mkinitcpio -P')
6. Copy the 2 files it created in the host /boot to the boot directory you have /dev/sda1 mounted on.
$this->bbcode_second_pass_quote('', 'i')nitramfs-linux.img
initramfs-linux-fallback.img

7. Unmount root and boot
8 Remove the SD Card and boot from the SSD.

There has to be a better way, but I have not found it. I did figure out a couple of things.

In November of 2021:
The u-boot is already fixed.
The latest firmware for the RPI4 supports USB booting.
Nothing in boot.txt needs to be changed.
It's just the pcie_brcmstb module in the /etc/mkinitcpio.conf file that needs updating and the initrd needs rebuilding.
jfabernathy
 
Posts: 30
Joined: Mon Jan 14, 2019 7:36 pm

Re: RPI4 boot from USB SSD with aarch64 2021-11 edition

Postby jfabernathy » Thu Dec 02, 2021 6:44 pm

Key learning from this. Don't pacman -Syu on the SDcard system you are using to build the USB SSD. Keep it original and I also took the image I used to build the SD card and put it in the /home/alarm directory of the SD card.

Also while booted on the SD card image, you'll need to use wifi-menu to get connected to install dosfstools.
jfabernathy
 
Posts: 30
Joined: Mon Jan 14, 2019 7:36 pm


Return to ARMv8 Devices

Who is online

Users browsing this forum: No registered users and 9 guests