USB Boot for Raspberry Pi
From KlavoWiki
Prerequisite
Before you can boot a rPi from USB you will need to update the eeprom if it has not already been done. As of writting any new rPi will need to be updated. Write an SD card to boot the rPi so the eeprom can be updated.
Make sure everything is updated.
apt update apt -y full-upgrade apt -y dist-upgrade apt -y autoclean apt -y autoremove
eeprom
Display Current Version
rpi-eeprom-update
Update
rpi-eeprom-update -a
Boot Order
By default the Pi will boot to USB then fall back to SD card. If both fail the system will then reboot and repeat the cycle.
To change the order.
rpi-eeprom-config --edit
Codes
Value | Mode | Description |
0x1 | SD CARD | SD card (or eMMC on Compute Module 4) |
0x2 | NETWORK | Network boot |
0x3 | USB DEV | USB device boot – See usbboot (since 2020-09-03) |
0x4 | USB MSD | USB mass storage boot (since 2020-09-03) |
0xe | STOP | Stop and display error pattern (since 2020-09-03). A power cycle is required to exit this state. |
0xf | RESTART | Start again with the first boot order field. (since 2020-09-03) |
Examples
Boot Order | Description |
0xf41 | Try SD first, followed by USB-MSD then repeat (default if BOOT_ORDER is empty) |
0xf14 | Try USB first, followed by SD then repeat |
0xf21 | Try SD first, followed by NETWORK then repeat |
0x1 | Try SD. If Fail do nothing. Cold reboot to try again. |
Create HDD
Once the above has been done write and existing SD card to a USB hard disk or just write your image of choice. You can use Win32diskImager to write the SD card to a file and then the file to the hard disk.
Reference
Official Raspberry Pi documentation.