Raspberry Pi 4 cannot boot when both of the USB 3.0 ports have storage devices attached
To reproduce
You'll need two identical USB sticks - same size, same brand and model. Let's assume you would boot the OS from one of them, while the other would be just a removable storage medium. Also, remove the SD card from the slot, if present. Let's go USB-only.
When you turn on the Pi with both sticks connected, it will first throw up these errors:
ERROR: failure to add disk device usb_mass_storage.lun0, r = 20
Cannot initialize UEFI sub-system, r = 20
I see the output from the serial console.
And then it will give up on USB and attempt to do a network-boot, at which point I can press Ctrl + C
until I'm dropped to the U-Boot prompt.
OK, turn it off now. We'll start it again, but this time leaving only the bootable OS disk. With only one USB device plugged in, it should boot successfully from it.
System info
- U-Boot 2021.10 (Sep 08 2023 - 11:13:24 -0600)
- Latest EEPROM version installed with raspi-config on Raspberry Pi OS (bookworm).
- Boot order set to boot from USB/NVMe first.
- OS: OpenBSD 7.4 (with full-disk encryption)
- Device: Raspberry Pi 4B (4GB)
Additional info
The second (not-bootable) disk does not have the bootable MBR flag - I removed it. [OpenBSD's version] of fdisk
automatically adds it. But it didn't make any difference.
I've experimented a bit with the U-Boot CLI, in an attempt to manually boot the OS. For example, when I run bootefi bootmgr
I get the error Cannot initialize UEFI sub-system
.
I will later gather and upload more detailed logs to this issue.
I believe the same problem was reported before on the FreeBSD Bugzilla tracker.