Skip to main content

How to Boot Raspberry Pi 4 From a USB SSD or Flash Drive

Raspberry Pi 4 USB Booting
(Image credit: Tom's Hardware)

 By default, Raspberry Pi boots up and stores all of its programs on a microSD memory card, which has a maximum theoretical bandwidth of 50 MBps on the Raspberry Pi 4 and just 25 MBps on prior models. Using an external SSD as your main storage drive could speed things up significantly, but up until just recently, you couldn't boot the Pi 4 off a USB device. However, new beta-level firmware lets you do just that. 

In our real-life tests of a Raspberry Pi 4 with SSD last year we got impressive performance with sequential transfer rates as high as 140 MB / 208 MBps for reading and writing. You can also use a standard USB flash drive, though we found the performance worse than a microSD card on many tasks.

 How to Boot Raspberry Pi 4 from USB

1. Boot from a standard microSD card with the latest Raspbian on it. 

2. Update your OS by typing:

sudo apt update
sudo apt full-upgrade

3.  Edit the /etc/default/rpi-eeprom-update file and change the FIRMWARE_RELEASE_STATUS value from "critical" to "beta." You can edit the file by typing:

Sudo nano /etc/default/rpi-eeprom-update

Raspberry Pi 4 USB Booting: Changing the eeprom-update file

Raspberry Pi 4 USB Booting: Changing the eeprom-update file (Image credit: Tom's Hardware)

After making the change, hit CTRL+X to exit. Make sure you enter Y when asked whether you want to save. 

 4. Install the beta bootloader by entering: 

sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2020-05-15.bin

If this fails, it's possible that there's a newer beta with a different filename. Check the /lib/firmware/raspberrypi/bootloader/beta/ directory to find out.

5. Reboot.

6. Check the firmware version to make sure your update took. You can get the version by typing:

vcgencmd bootloader_version

You should see that the firmware date matches the name of the beta file, which in our case was May 15th.

Raspberry Pi 4 USB Booting: Confirming your firmware.

(Image credit: Tom's Hardware)

 7. Copy your microSD card to your USB drive or burn a new Raspbian image to your USB drive. You can copy your existing microSD card by using the SD Card Copier application (under accessories) that comes with Raspbian. To burn a fresh install of Raspbian onto your USB drive, use Raspberry Pi Imager as you normally would when setting up a Raspberry Pi

Raspberry Pi 4 USB Booting: Copying Your Card

(Image credit: Tom's Hardware)

 8. Download all the *.dat and *.elf files from the /boot folder of Raspberry Pi's firmware master branch on Github.

9. Copy the *.dat and *.elf files into the boot partition on your USB drive, allowing them to overwrite the files with the same names. 

Raspberry PI 4 USB Booting: Copying Files

(Image credit: Tom's Hardware)

 10. Shutdown your Raspberry Pi and remove the microSD card.

You should now be able to boot your Raspberry Pi 4 off of the USB device. Keep in mind that, if you are using an external drive that saps a lot of power from the bus, you may have issues (which you could probably solve by using a drive that has its own power source or by using a powered USB hub).  

Raspberry Pi 4 USB Booting: Connected to a SATA SSD

(Image credit: Tom's Hardware)

For example, we had problems using a bus-powered, external Kingston HyperX SSD, which booted but -- perhaps because of how much power it was using -- none of our peripherals would work. A SATA SSD in a externally powered dock worked fine as did a USB Flash drive.

  • RobU
    Any idea if this will enable the Raspberry Pi 4 to be a viable Plex Media Server?
    Reply
  • CS_J
    These instructions resulted in an error and also caused my pi to stop booting from the SD card.

    When restarting after removing the SD card, I got an error on the bootloader screen saying:

    Invalid ELF header: 'start_x.elf'
    Firmware not found

    And it would keep repeating and showing this error.

    Then I tried reinserting my SD card and now it is showing the same error, even without the USB drive plugged in.

    What has happened? I can't boot using my original SD card.
    Reply
  • mmarks9156
    CS_J said:
    These instructions resulted in an error and also caused my pi to stop booting from the SD card.

    When restarting after removing the SD card, I got an error on the bootloader screen saying:

    Invalid ELF header: 'start_x.elf'
    Firmware not found

    And it would keep repeating and showing this error.

    Then I tried reinserting my SD card and now it is showing the same error, even without the USB drive plugged in.

    What has happened? I can't boot using my original SD card.
    I tried this as well and did not have the issue with my sdcard booting on RPI4 but the USB boot did not work and got same error on bootup.
    Reply
  • CS_J
    mmarks9156 said:
    I tried this as well and did not have the issue with my sdcard booting on RPI4 but the USB boot did not work and got same error on bootup.
    Yeah, I'm not sure why my sd card started getting the same error... Maybe I accidentally copied the bad start_x.elf to it or something. Anyway, I think there might be an issue with the current start_x.elf from the Github. Will wait for the OP's response.
    Reply
  • mmarks9156
    CS_J said:
    Yeah, I'm not sure why my sd card started getting the same error... Maybe I accidentally copied the bad start_x.elf to it or something. Anyway, I think there might be an issue with the current start_x.elf from the Github. Will wait for the OP's response.
    I'll do the same.
    Reply
  • FrenchPi
    Hi, that sounds fantastic ! May I ask where is now the previous way of doing described ? (i.e. sudo fdisk -l; sudo mkfs.ext4 /dev/sda1 etc) ?

    BTW, is there a way to upgrade from previous way to this new way so to maintain what was already installed on the SSD, and not to have to re-install it all ?
    Reply
  • Daniel Glasser
    @FrenchPi : I am not an authority on this, but my answer is a qualified "yes". I have successfully done the firmware upgrade without messing up my USB external drive contents or configuration.
    In my case, I had partitioned the external drive (a 1TB Seagate "Backup Plus Portable" USB 3.0) as follows:
    /dev/sda1 vfat (1GiB, Primary) "USBBOOT"
    /dev/sda2 - (938.5 GiB, Extended)
    /dev/sda5 ext4 (128.0 GiB) "/"
    /dev/sda6 swap (8.0 GiB) "swap"
    /dev/sda7 ext4 (223.0 GiB) "/srv"
    /dev/sda8 ext4 (502.0 GiB) "future" (not mounted)Note that this does not follow the SD card partitioning (at least for the "Noobs" image) which appears to have "Recovery" as the primary partition, and in the extended partition, a partitions for "/boot", a "Settings" partition that doesn't seem to get mounted, and the root partition.

    I have been booting off of an SD card with my root file system on the external drive for months now with no problems. It's much faster, and more spacious, than the SD card. "/boot" was still mounted from the SD card in "/etc/fstab", but everything else was mounted from the external hard drive.

    The following are the steps I then followed:
    I followed the directions for from the article, doing the "apt" update and full-upgrade, editing the file "/etc/defaults/rpi-eeprom-update" and performing the "rpi-eeprom-update" followed by a reboot.
    After the update, I checked the firmware with "vcgencmd bootloader_version", but it reported the old firmware.
    I disconnected the external HD and booted off the 32 gig SD card I had originally installed Raspbian on and ran the same steps again.
    After reboot, the "vcgencmd" reported the expected May 15th date.
    I connected the USB drive; all of the partitions of note on the HD auto-mounted under "/media/daniel" (substitute your own username for "daniel"). I copied all of the files from the current "/boot" to the HD's boot partition (/dev/sda1), then edited the "etc/fstab" on /dev/sda5 to mount /dev/sda1 for "/boot" instead of the SD card partition.
    I shut down the Pi, turned off the power, and removed the SD card. Turned the power back on.
    It tried to boot. The monitor showed a text console telling me that it could not find "recovery.elf" and that "start.elf" is not compatible, and I should download the latest from a URL. I turned it off and put my usual boot SD (an 8 gig with a modified "cmdline.txt" file to put root on /dev/sda5) into the board, powered the PI back up and it booted fine.
    I went to the Raspberry Pi "downloads" link and read the release notes for the beta bootloader. It said the ".elf" files would be made available soon. I didn't see any new ".elf" files in the repository.
    I checked around, and found another article that included using the command "rpi-update" after the "apt full-upgrade", with a reboot after the "rpi-upgrade".
    I ran "sudo rpi-update" and confirmed that I wanted to do it. It took a little while, but it completed without errors.
    Note: Because I had edited the "/etc/fstab" on /dev/sda5, when I ran "rpi-upgrade", it put the new files in the vfat filesystem on /dev/sda1, not on the SD card from which the Pi actually booted. This installed the correct "start.elf" on the hard drive.I rebooted with the SD card, then ran the "rpi-eeprom-update" again, just to be safe.
    I rebooted once more with the SD card and verified that "vcgencmd bootloader_version" reported the correct boot firmware.
    I shut down, removed the SD card, and turned the Pi back on.
    The scary messages about not finding "recovery.elf" still appeared, but after a few seconds, the screen blanked, then went through what's pretty much the normal boot (screen has a flashing text cursor in the upper right hand corner, then the cursor goes away, and after a while, the login screen is displayed.)I now have a Pi 4 that boots from an external USB 3.0 hard drive without an SD.

    I hope this rather disorganized and overly long description helps someone.
    Reply
  • deesider
    RobU said:
    Any idea if this will enable the Raspberry Pi 4 to be a viable Plex Media Server?
    It already was before. This latest update doesn't make a huge difference, it just allows for the USB drive to completely replace the SD card. Previously the SD card was still required for the boot files and the root file system could be located on the USB drive.

    The access speed for files from the drive will certainly be fast enough. The limiting factor for use as a Plex server is whether any transcoding needs to take place on the Pi. If it does it will struggle.
    Reply
  • Bears695
    As noted in a reply above, if you flash the Noobs image to your USB or SSD drive your Pi will not boot. You need to use a plain version of Raspbian. The Noobs image has a recovery partition before the boot partition that prevents booting. The Pi imager has plain images
    Reply
  • cwoodhouse
    CS_J said:
    These instructions resulted in an error and also caused my pi to stop booting from the SD card.
    When restarting after removing the SD card, I got an error on the bootloader screen saying:
    Invalid ELF header: 'start_x.elf' Firmware not found

    I got same error.

    Used the method in this link: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md
    Basically, instead of downloading from Github, use rpi-update to update the boot sector on the SD, then copy *.dat and *.elf from the SD card to the \boot directory on the SSD (I did that in the Windows environment).
    Reply