Home Featured Raspberry Pi How to boot Raspberry Pi 4 from USB

How to boot Raspberry Pi 4 from USB

It's time for SSD, mSata and M.2 on our favourite board!

I completely ignored the experimental methods, because the Raspberry Pi 4 I want to update is too important to me to risk it. It’s been a couple of weeks however and it’s finally very simple to boot Raspberry Pi 4 from USB. I’m going to try this on the latest Raspberry Pi 4 (8GB RAM) and the DIY NAS kit by SunFounder (review) I reviewed earlier with a PNY SSD for storage. The method will work with all Raspberry Pi 4 boards, takes about 10 min and requires a microSD card and SSH access to your board.

Getting started

A micro SD card is still needed to create the image for the SSD drive and to configure the boot-loader correctly. Download the latest version of Raspberry Pi OS using the RPI imager (by far the easiest option) choose the image type and flavour (full|lite.. etc) and burn it to an SD card. I’m going to use the lite version.

Add an ssh empty file to the root directory (create a new file, name it ssh and delete the extension) of the sd card so you can access your board over SSH. Log in with default credentials (pi, raspberry) using PuTTY or a similar terminal client and update the card:

sudo apt-get update
sudo apt-get full-upgrade -y  (-y flag skips the confimration step)
sudo reboot 

You will need a USB storage. You can try it with the USB stick (not recommended due to speeds), USB drive, USB SSD drive or use one of the add-ons like these to boot Raspberry Pi from USB attached mSATA or M.2 drive.

You will need to format the drive. Check the drive name with sudo fdisk -l you will see the drive listed as /dev/sda or /sdb (depending on the number of drives linked). At this point, I would strongly recommend you to format the drive.

Use sudo fdisk /dev/sdaand d to delete, provide the number for the partition if you have more than one, repeat the process until you have deleted all partitions. Use p to create a new partition and w to save the changes.

Buy mSATA board for Raspberry Pi 4

Buy it using these links to support NotEnoughTech.

Boot Raspberry Pi 4 from USB

We have almost everything ready to boot Raspberry Pi 4 from USB. Let’s start with modifying the firmware channel. This tells your Raspberry Pi 4 what firmware it will use for the EPROM update. EPROM keeps the information about Raspberry Pi 4 boot. Open the file with nano:

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

And modify the firmware channel to from "critical" to "stable":

FIRMWARE_RELEASE_STATUS="stable"

Save the changes with Ctrl+X and Y. Now we are ready to modify the bootloader defaults. In the bootloader directory, you will find files that can be used to set the boot behaviour.

cd /lib/firmware/raspberrypi/bootloader/stable/
ls
pieeprom-2020-04-16.bin pieeprom-2020-06-15.bin recovery.bin vl805-000137ad.bin

The latest file is pieeprom-2020-06-15.binand this is the file you should be using to boot Raspberry Pi 4 from USB.

Assuming you are still in the same directory, run sudo rpi-eeprom-update -d -f pieeprom-2020-06-15.bin. Use the TAB key to fill in the name after typing a couple of letters. It speeds things up! If you did everything well your boot is ready – you should see this on the screen.

BCM2711 detected
VL805 firmware in bootloader EEPROM
BOOTFS /boot
*** INSTALLING /lib/firmware/raspberrypi/bootloader/stable/pieeprom-2020-06-15.bin ***
BOOTFS /boot
EEPROM update pending. Please reboot to apply the update.

Don’t listen to them just yet, we have to make copy the system onto your USB medium.

Buy M.2 for Raspberry Pi 4

Buy it using these links to support NotEnoughTech.

Raspberry Pi OS Image to SSD

There are options to do this, but by far the easiest one for a person who isn’t really great at Linux-fu is this script. Thanks, Bill! You will need git installed so let’s quickly do that with sudo apt-get install git(I picked the Raspberry Pi OS Lite).

Now that you can clone the repository, let’s set it up:

git clone https://github.com/billw2/rpi-clone.git 
cd rpi-clone
sudo cp rpi-clone rpi-clone-setup /usr/local/sbin

And you are ready for some action! List the drives present on your system: sudo fdisk -l and identify the one you wish to use as the new boot source. You will need to copy the data onto that drive to boot Raspberry Pi 4 from USB. My drive was labelled as /dev/sda so the command is:

sudo rpi-clone -l sda

From now on, the process is mainly automatic and it should only take you a couple of minutes. You will be asked to confirm the details of the process, so read the screen info and make sure that the presented values are correct. Once backup job is complete – it’s all done. So be a good maker and power down your Raspberry Pi 4 board sudo poweroff, take out the SD card and enjoy the boot from USB.

FAQ:

  1. Can I use that drive for other Raspberry Pi 4 boards?
    No, Raspberry Pi will store the default boot option in the EPROM so unless you configure the new board first, you won’t be able to swap the USB drives as you could with micro SD cards.
  2. Can I make the backup of that modified image?
    Yes, read more about the rpi-clone – it has the option to resize the partitions to fit the new partition size. One of the unwanted consequences is that the unmodified image size taken from the (unpartitioned) drive, will have the drive size – so in my case just shy of 256GB! Regardless of how much of that space is actually used.
  3. Can I go back if I don’t need it anymore?
    Yes, to reverse the process, simply power down the Raspberry Pi 4, burn a fresh image of Raspberry Pi OS and put the card in – then power the board as normal! Just remember if you do this, your boot drive won’t work any more.

Final thoughts

The process is much simpler now. I hope this guide helps you to boot Raspberry Pi 4 from USB! If you have the drive to spare – go ahead and use it! I will be using this with my mSata add-on board for Raspberry Pi 4 with Argon18 case mod for Argon one (review). It should make the Raspberry Pi 4 run very well for years to come! Let me know if you have any questions about this process in this Reddit thread.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

SATA HAT

Add an SSD to Raspberry Pi 4 and turn it into a super-cooled NAS drive.

More HATs

Argon One

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO

More cases on

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Free wireless doorbell (Amazon Dash button hack)

0
The most terrifying situation I can imagine* is missing a parcel

Raspberry Pi NAS: (NAS-pi) Modding like a boss #part2

0
Plex and RAID1 NAS drive build log

MagPi – auto-downloader

0
Grab each edition of Mag Pi as soon as possible!

HOW TO...

How to boot Raspberry Pi 4 from USB

0
How to set up and boot Raspberry Pi 4 from USB drive - headless guide.

Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables

0
Getting Raspberry Pi boards connected in seconds

Everything you need to start using JSON

0
It's JSON not Jason, just saying!

How to use Join App in NodeRED

0
The day finally comes where Join app is almost everywhere!

Driving LCD with Arduino and Raspberry Pi

0
Displaying things on an LCD screen is as easy as going through a cup of jellybeans while writing this tutorial!