Raspberry Pi - How To Boot from USB
USB boot is for these models only: Raspberry Pi 2B v1.2, 3A+, 3B, 3B+, and 4B. It allows you to boot from a flash drive or a USB hard disk.
- A USB flash drive is likely to be slower than an SD card. An SSD is likely to be faster.
- Some USB drives just won’t work.
- More than one disk will probably require power ( USB hub or enclosure ).
WARNING - Some people have reported having issues even after putting their SD card back into the system. Follow all of these steps at your own risk.
How to Boot Raspberry Pi 4 from USB
You are going to need to install the latest bootloader EEPROM image and change some of the boot settings so you will need to boot from an SD card first before you can enable booting from a USB device. You can upgrade your EEPROM with a special image that can be written to an SD card but we are going to do this from within Raspberry Pi OS instead since we need to make changes to the boot settings anyways.
Upgrade the system:
sudo apt update
sudo apt full-upgrade
Upgrade the kernel and firmware ( might not need this and it could be dangerous because it is pre-release):
sudo rpi-update
Reboot:
sudo reboot
Install the latest bootloader EEPROM image:
sudo rpi-eeprom-update -d -a
Reboot:
sudo reboot
Start raspi-config
sudo raspi-config
Select the following:
- 3 Boot Options
- B5 Boot ROM Version
- E1 Latest
- Reset boot ROM to defaults? No
- B4 Boot Order
- B1 USB Boot
- Would you like to reboot now? No
Do the following
- Attach your USB drive to a USB 3 port.
- Launch the SD Card Copier:
- start menu ==> Accessories ==> Launch SD Card Copier
- Select the correct devices and click start.
- Shutdown the system.
- Remove the SD card.
- Power up
You should be all set. Your system should boot from the USB Drive.
Raspberry Pi 2B v1.2, 3A+, 3B, Compute Module 3
You need “to set the USB host boot mode bit in the one-time programmable (OTP) memory”
You will need to boot into Raspberry Pi OS first.
Check if this bit is currently set:
vcgencmd otp_dump | grep 17:
You will see this if it is set:
3020000a
If it isn’t, run this to set it in a config file on your SD card:
echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt
Reboot to pick up the change from the SD card:
sudo reboot
Check again:
vcgencmd otp_dump | grep 17:
You should see this:
3020000a
NOTE - Once the SD card has this setting, it can be used to set this bit in OTP memory on other Raspberry Pi systems that boot from the same card.
NOTE - Any change you make to the OTP is permanent and cannot be undone.
On the Raspberry Pi 3A+, setting the OTP bit to enable USB host boot mode will permanently prevent that Pi from booting in USB device mode.
Raspberry Pi 3B+, Compute Module 3+
These shouldn’t require any changes to be made. Just insert your USB device and make sure that no SD card is inserted ( these boot first ).
You can write an OS image to a USB device the same way that you write it to an SD card.
Special bootcode.bin-only Boot Mode
There is another method of getting a Raspberry Pi to boot from USB. You can first boot from an SD card with a special binary file which will then boot from a USB device. This does not work for the Raspberry Pi 4 B. It should probably work on all other Raspberry Pi models.
- Download the binary file HERE
- Format an SD card as FAT32
- Place the bootcode.bin file on this SD card
- Boot from SD card ( only loads bootcode.bin )
- It will then boot whatever is on the USB drive
Known issues (not Pi 4)
-
“The default timeout for checking bootable USB devices is 2 seconds. Some flash drives and hard disks power up too slowly. It is possible to extend this timeout to five seconds (add a new file timeout to the SD card), but note that some devices take even longer to respond.”
-
“Some flash drives have a very specific protocol requirement that is not handled by the bootcode and may thus be incompatible.”