Booting a Raspberry Pi from USB 3.0 Port Plugged in Device (e.g. SSD, HDD, FlashDrive)

Booting your Raspberry Pi from the SD Card can be slow and SD Card’s aren’t the most long lasting forms of media for physical data retention. Neither are NVME SSD’s but their write speeds are really good.

To set up your Raspberry Pi to boot from USB, the details can be summarized as:

  1. Firmware upgrade to have the Raspberry Pi boot from USB first
  2. Installing Raspbian (or Ubuntu Server) on an external Storage Device
  3. Booting from that storage device

Prerequisites

  1. Installation of Raspberry Pi Imager
  2. An extra Micro SD Card (any size, this is just a temporary image and you can reuse the card if you want)
  3. An external Storage Device (e.g. NVME SSD with a USB adapter, flash drive)
  4. Raspberry Pi and all the goodies

Assuming you have Raspberry Pi Imager installed, open it and navigate to the Operating System select

Scroll down and select Misc utility images

Select USB Boot

With that selected, click on your storage device

Choose a free storage device and then click Write

Eject the SD Card, place it into the Raspberry Pi and boot the Pi up

Have HDMI selected on your monitor

Wait until the green screen appears. That means the bootloader wrote correctly

Open up Raspberry Pi Imager again, and this time when selecting an Operating System, select the one you want. I chose Ubuntu Server 64-bit for mine since I’m running a Raspberry Pi 4.

Have your external storage device connected and click Write

Once complete, plug the storage device to the Raspberry Pi, turn it on and you should immediately be able to boot

I ran a quick df -h command to see what the OS was currently installed. For this example, I’m running it on an extra NVME drive I had lying around

I also ran a little file write speed test to see how much better this drive was than an SD Card (I don’t have metrics for SD Card but I promise it’s faster)

dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

Source: https://kenichishibata.medium.com/test-i-o-performance-of-linux-using-dd-a5074f1de9ce

That’s pretty much it. You’re now running an operating system booting off a USB device on your Raspberry Pi!

Thanks for reading

Leave a Comment

Your email address will not be published. Required fields are marked *