Booting from mSD card with USB drives attached on RPi4

I've installed 13.0-RELEASE on a micro SD card to use on a 8GB Raspberry Pi 4. The Raspberry Pi 4 boots from the card just fine, but when I also attach a USB SDD enclosure and try to boot, u-boot will fail to boot the micro SD card and quickly move on to attempting to boot from USB, which will also fail because the USB drives are for storage, and then go into endless trying to boot over the network.

To work around the problem, I have to detach the USB drives, power on the Pi, wait a few seconds, and then attach the USB drives. This is really not ideal, since I want this device to be my DHCP and DNS server so it should come up without hassle.

I've tried the 2021-04 build of u-boot, and whilst that will boot with the USB drives attached, it will then not import the ZFS pool on boot.

How can I get u-boot to not give up on the micro SD card so quickly, but still properly detect the USB drives?
 
Hi,
I actually tried this the other day and failed miserably. You cannot boot from a microSD, even in a usb adapter. I managed to get it to the boot screen, where it asks for a language, etc, before it crashed. It crashed dozens of time before reaching this screen. Idk what causes it, but i’d highly recommend buying a flash drive for this purpose instead of wasting countless hours on it. Hope this helps you.
 
I've tried the 2021-04 build of u-boot, and whilst that will boot with the USB drives attached, it will then not import the ZFS pool on boot.
Off the top of my head, I'd suggest looking at options offered by u-boot. Maybe on the screen you attached to your Pi, maybe on the project's web page... There might be something for fine-grained control like timing. I know I sound like the BOFH who tells users to RTFM, but I still would encourage reading the manual, and be able to stop and think at any given step...
 
This sounds quite like your external USB drives have no own power supply, and instead use the power provided by the Raspi. The Raspi is not meant to be able to power USB drives on its port. If that's really the case, try switching over to USB drives with external power supply instead, or use an external HUB with own power supply.


Please also note that the Raspi is an ARM based computer, and has no BIOS. In order to boot correctly it needs an inserted SD card with the proper files in place. If that's not there, it will not boot.
 
This sounds quite like your external USB drives have no own power supply, and instead use the power provided by the Raspi. The Raspi is not meant to be able to power USB drives on its port. If that's really the case, try switching over to USB drives with external power supply instead, or use an external HUB with own power supply.


Please also note that the Raspi is an ARM based computer, and has no BIOS. In order to boot correctly it needs an inserted SD card with the proper files in place. If that's not there, it will not boot.
I think you misunderstand my question, I am not trying to boot from USB and I am not trying to get rid of the microSD card. I want to boot from microSD whilst there are USB storage drive(s) attached. For the record, the enclosure does have its own power supply.

Raspi4 allows booting from various devices as well as netbooting and you can set the boot order. See https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
linux and plan9 boot directly, while freebsd relies on uboot so it would need to do the right thing as well.
The Raspberry Pi's boot order is correct, it launches u-boot from the microSD card, but u-boot is not doing the right thing, and my precise question is how to configure u-boot to do the right thing.

Off the top of my head, I'd suggest looking at options offered by u-boot. Maybe on the screen you attached to your Pi, maybe on the project's web page... There might be something for fine-grained control like timing. I know I sound like the BOFH who tells users to RTFM, but I still would encourage reading the manual, and be able to stop and think at any given step...
There indeed might be, but it was certainly not obvious, at least not to me, when I searched for any thing like this, in the documentation, the mailing list, and the internet as a whole. Either way, I don't particularly have the time to be diving into bootloader code if there is not some straightforward way of configuring u-boot.

Hi,
I actually tried this the other day and failed miserably. You cannot boot from a microSD, even in a usb adapter. I managed to get it to the boot screen, where it asks for a language, etc, before it crashed. It crashed dozens of time before reaching this screen. Idk what causes it, but i’d highly recommend buying a flash drive for this purpose instead of wasting countless hours on it. Hope this helps you.
Although it should be unnecessary, it boots fine from a microSD card by itself after all, I think putting FreeBSD on a USB device and booting from that might be the simplest solution here...
 
Back
Top