By default, your Raspberry Pi boots up from the SD card that contains the operating system. Here we will show how you can ditch the microSD card and boot your Raspberry Pi 4 from USB right from an external SSD drive.
Why You Should Ditch microSD Storage
While the microSD storage solution is adequate for most small projects and simple IoT applications, it isn’t optimal when the Raspberry Pi 4 is used as a full-blown computer. Apart from the obvious speed difference between an SSD and microSD card, the latter quickly emerges as the weak link in applications requiring frequent writes to the file system.
While both the SD card and SSD make use of the NAND flash memory, they are not the same. The NAND flash cells in a microSD card can only be overwritten a finite number of times, and the frequent writes to the file system will wear out the microSD storage very quickly.
A modern SSD, on the other hand, employs a sophisticated on-board processor to perform automatic wear-levelling routines. This prevents uneven wear of the NAND flash modules. SSDs also have a larger array of these flash modules to spread out writes sparsely. This makes them better at withstanding the wear and tear of frequent disk writes compared to microSD storage.
Booting From an SSD Isn’t Straightforward
Since the Pi 4 isn’t equipped with an onboard SATA or m.2 connector, the USB 3.0 port is the only way to connect a 2.5-inch or m.2 SSD. Booting the Pi 4 off USB also requires updating the firmware. Messing with the device’s EEPROM is a risky affair, so make sure your Pi 4 doesn’t abruptly lose power during the process.
Furthermore, not all USB 3.0 to SATA/m.2 adapters play well with the Pi 4 at this juncture. The Raspberry Pi foundation is working on getting USB boot to work reliably with all USB-to-SATA SSD enclosures, but there’s no telling when the feature will be integrated into a future official release of Raspberry Pi OS. Until then, booting reliably through an SSD is a matter of finding the right external USB enclosure. But even if your SSD or USB enclosure combination doesn’t work, booting through a fast and compact USB 3.0 flash drive, such as the Samsung Fit, is still better than the slower microSD card.
Before you buy a new 2.5-inch SSD enclosure, make sure it supports UASP (USB Attached SCSI Protocol). This new protocol uses a faster SCSI command set and leverages the wonders of parallel communication through Native Command Queuing to improve transfer speeds considerably.
Here’s what you need for this endeavor:
- Raspberry Pi 4
- Existing microSD card with Raspberry Pi OS installed
- SSD with a USB 3.0 enclosure. You also need a 2.5-inch USB drive enclosure.
- Internet connectivity for firmware and system updates
How to Boot Raspberry Pi 4 from USB
1. Boot your Pi from the microSD card.
2. Upon reaching the desktop, open terminal and type the following commands to update the distribution.
sudo apt update sudo apt full-upgrade
3. With the OS updated, the system must be prepped to receive the latest stable firmware update. This calls for editing a specific system configuration file.
sudo nano /etc/default/rpi-eeprom-update
4. The default value of the
FIRMWARE_RELEASE_STATUS parameter is “critical,” which must be changed to “stable” in order to install the latest firmware. Press Ctrl + O to commit changes to the file and then Ctrl + X to exit.
5. Update the firmware with the following command to enable the new bootloader.
sudo rpi-eeprom-update -d -a
6. After the update has completed successfully, reboot your Raspberry Pi 4.
7. Verify whether the update was successful by typing the following command in the terminal.
The latest firmware update will be displayed. It should be the June 15, 2020, or later release for the USB boot feature to work successfully. The latest stable bootloader version as of this writing was July 16, 2020.
8. Next, clone your microSD card onto the SSD that you intend to use as the new boot device. This is best done with the “SD Card Copier” application found in the Accessories section of the Raspberry Pi OS GUI.
9. Shut down the Raspberry Pi 4, remove the microSD card, and connect the USB boot drive.
10. Power the Pi 4 again and wait patiently for the OS to boot from the USB drive. If you see the screen below, congratulations, as you have successfully managed to boot your Raspberry Pi 4 from a fast storage medium attached through the USB port.
The Raspberry Pi 4 can be a powerful device if you can unlock its potential. By switching to SSD, you can easily get a performance boost and use it for more intensive operation, like running a web server or a minecraft server.
Our latest tutorials delivered straight to your inbox