Booting a Raspberry Pi from USB
For faster disk IO on the Raspberry Pi, it’s possible to boot from a USB drive. To get an idea of the performance gains, see the work done by Jeff Greerling.
For my setup, I used 3 Raspberry Pi 4s and a variety of drives/enclosures I picked up on sale. The best performing setup was with a WD NVMe drive and an external enclosure.
Setup
Booting the Raspberry Pi from USB is a fairly straight forward process. You must update to the latest firmware and change the boot order.
Updating Firmware
Flash an SD card with the Raspberry Pi OS. You can use the Raspberry Pi imager tool to prepare the SD card. I used the Lite version of the Raspberry Pi OS which doesn’t have a desktop environment. To enable ssh access to the device, you can simply create an empty file named “ssh” in the root directory on the SD card.
Once booted, you should be able to ssh into the pi using the default user “pi” with password “raspberry”.
You can now run the following commands to update the firmware.
sudo apt update
sudo apt full-upgrade
sudo rpi-update
Now reboot the device.
sudo reboot
Once the device is rebooted, you can run the following command. Note: when I ran this command, nothing seemed to happen - your mileage may vary.
sudo rpi-eeprom-update -d -a
Finally, using the raspi-config menu, you can change the boot order to USB Boot. If there is no SD card present, the device will now boot from USB.
sudo raspi-config
Preparing a USB Boot Drive
Once again using the Raspberry Pi imager tool, you can flash your OS of choice onto your USB drive. I used Ubuntu 20.10 Server 64bit.
Booting from USB
Power down your Pi, remove the SD card and plug in your USB device into one of the USB 3 ports. Your device should now boot from your USB drive when you power it back on!