It is certainly possible to avoid using the SD card for boot - none of my Pi devices use the unreliable SD card interface and all boot either from the network or an SSD via the USB port.
Boot order
The boot order is determined by the value held in BOOT_ORDER
, in the EEPROM, and is read from right to left:
Value Mode Description
0x0 SD CARD DETECT Try SD then wait for card-detect to indicate that the card has changed - deprecated now that 0xf (RESTART) is available.
0x1 SD CARD SD card (or eMMC on Compute Module 4).
0x2 NETWORK Network boot - See Network boot server tutorial
0x4 USB-MSD USB mass storage boot
0xf RESTART Restart from the first boot-mode in the BOOT_ORDER field i.e. loop
You need to change your BOOT_ORDER
, from the default, which might be probably 0xf21
, to include 0x4
. So, either:
0xf14
which will attempt to boot from USB first and then the SD card, or;
0xf41
which will attempt to boot from SD card first and then the USB, or;
0xf42
which will attempt to boot from network first and then the USB, or;
0xf24
which will attempt to boot from the USB first and then the network.
You can include four options, so:
0xf241
which will attempt to boot from the SD card first, then the USB and then the network.
In all cases, the f
at the beginning just means that the boot attempts will cycle around, if all of them fail the first time. Basically, it will sit there repeatedly trying each device.
Update first
Note: USB boot was only introduced in the EEPROM from 9-03-2020 onwards, so it depends upon the age of the Pi and when/if the EEPROM was updated, whether your Pi has this capability or not. So you may need to update your EEPROM.
Nevertheless, even if you already have this ability, it is best to update to the latest version of the EEPROM firmware.
To update your system to get the latest version of the rpi-eeprom
package:
sudo apt update
sudo apt full-upgrade
Then you can change the boot order using
sudo -E rpi-eeprom-config --edit
and append
BOOT_ORDER=0xf241
for SD card, then USB, then network and then repeat cycle.
Possible problem configuring
Note that, if your Pi is not already configured with the appropriate boot order (i.e. it does not include 0x4
), then it may never boot from anything useful (i.e. USB), which means that you can not to set the boot order appropriately.
That is to say, if the Pi isn't already configured to boot from USB, and seeing that your SD card slot is broken, then you are pretty much in a pickle... and you won't be able to boot your Pi, in order to configure it.
It is a bit of a chicken and egg situation.
If that is the case, then your only hope is that your default boot order is for SD card first and then the network, i.e. 0xf21
(or vice versa). If so, then you can set up a network boot server (using bootp
, dhcp
, nfs
, and tftp
) to boot the Pi, for you to then be able to configure the BOOT_ORDER
to include USB booting (i.e. 0x4
).
Notes:
I found that the default value (from the factory) of my BOOT_ORDER
was 0xf14
, so it just worked out of the box - USB first and then SD card.
If BOOT_ORDER
is not present, then the default boot order is SD card and then USB. Under BOOT_ORDER EXAMPLES, for 0xf41
it states:
Try SD first, followed by USB-MSD then repeat (default if BOOT_ORDER is empty)
Again, this will only work if you have EEPROM firmware from 9-03-2020 onwards, which is when USB boot support was added to the firmware.
For reference, I documented my whole discovery and configuration issues whilst attempting this in May 2022, in this blog, Raspberry Pi 4 - SD to SSD. Most of the information from that blog is in this answer, although my notes about the whole process and the reference links may prove to be of some use to you
BOOT_ORDER
but does boot from USB (at least last time I tried). The doc says Try SD first, followed by USB-MSD then repeat (default if BOOT_ORDER is empty) . Might be worthwhile adding to the blog. – Milliways Jan 22 '23 at 00:35BOOT_ORDER
on a Pi 4 I have here and it is currently0xf41
. In case that's relevant, its SD card was written with Raspberry Pi Imager with the 64-bit Raspberry Pi OS lite. – AndreKR Jan 23 '23 at 05:00