Raspberry Pi Boot from USB

In this Raspberry Pi boot from USB guide, we will be showing you how it is possible to boot your chosen operating system from a USB storage device instead of the standard SD card.

Raspberry Pi Boot from USB

We will walk you through the steps required to activate the USB boot mode in the one-time programmable (OTP) memory. You will need a newer Raspberry Pi to complete this tutorial correctly (see below).

There are various reasons why you might want to utilize a USB storage device to boot from instead of an SD Card. One of these reasons is just how much cheaper USB storage tends to be SD Cards. The other is that they tend to be easier to deal with when needing to swap out storage devices often.

Using a USB drive might come in handy if you want to want to run a retro game emulator, NAS (network attached storage) or other projects that require a lot of room to be useful.

Please note that this guide will only work with the Raspberry Pi 2B v1.2 and the Raspberry Pi 3B, 3B+, 3A+. Older Raspberry Pi’s sadly lack the ability to boot from the USB.


You will need the following equipment for this guide on booting your Raspberry Pi from a USB storage device.


Raspberry Pi

Micro SD Card if you’re using a Raspberry Pi 2, 3 or B+

Power Supply

Ethernet Cord (Recommended) or Wifi dongle

USB Storage Device


Raspberry Pi Case

USB Keyboard

USB Mouse

USB SD card reader

Setting up the Raspberry Pi for USB Booting

Before you begin, make sure that you are following this tutorial on a Raspberry Pi 3B, 3B+, 3A+ or a Raspberry Pi 2B v1.2. Other models of the Raspberry Pi do not properly support USB boot.

If you have a Raspberry Pi 3B+, you can skip to the next section of the tutorial as the USB boot bits are already set within the one-time programmable (OTP) memory on the device.

1. To begin this part of the guide, you will need to start off with an SD card with Raspbian installed.

For the purposes of this guide, you can just use Raspbian Lite as we only need the command line.

2. Once you have your Raspberry Pi booted up into the Raspbian operating system go ahead and enter the following command into the terminal.

These commands will ensure that the Raspberry Pi is entirely up to date and has all the features that we require.

sudo apt-get update
sudo apt-get upgrade

3. With Raspbian up to date, we can now enter the following command into the terminal.

This command writes the text program_usb_boot_mode=1 to the boot configuration file so that when the Raspberry Pi boots up, it knows that it needs to write data to the OTP for USB boot mode.

echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt

4. With the correct data added to the /boot/config.txt file we need to restart the Raspberry Pi by running the following command.

sudo reboot

5. Once the Raspberry Pi has finished rebooting, we can verify that the OTP has been written to by running the following command.

We utilize the Raspberry Pi’s vgencmd tool to provide a dump of the OTP, and from the result of this, we use grep to see if the text 17: can be found within the returned data.

vcgencmd otp_dump | grep 17:

6. If everything has worked correctly, you should see the following text appear in your command line from the previous command.


7. Now before we go and move onto setting up our USB with Raspbian, we will remove the line that we added earlier to the config file by running the following command.

sudo sed -i 's/program_usb_boot_mode=1//g' /boot/config.txt

How to boot Raspbian from USB

Booting the Raspberry Pi from a USB

1. Setting up a USB for your Raspberry Pi is extremely simple to do, and it’s just like installing Raspbian to an SD Card, instead of selecting your SD Card reader you will choose the USB storage device that you want to format.

Below we will do a quick run through of using Etcher to write to your USB device.

2. Start off by grabbing the version of Raspbian that you want your Raspberry Pi to boot from your USB device.

You can find all three versions of the operating system by going to the Raspbian download page. Download the version that best suits your needs.

3. Now that you have the image that you want, you will need to grab Etcher to be able to write the image to your USB device.

You can find the download for the Etcher tool by going to Etchers websitse.

4. Once you have Etcher downloaded and installed to your computer, launch it and press the Select Image button.

Within this menu browse to where you downloaded your copy of Raspbian and select it.
Etcher Select Image

5. Next, click the Select Drive button. In the prompt that appears find your USB storage device that you want to use as your boot drive for the Raspberry Pi and click the “CONTINUE” button.

Etcher Choose SD Card

6. Finally, click the Flash! button to begin the flashing process. This process can take some time.

Once completed, take out your USB Drive and place it into a USB port on your Raspberry Pi.

Etcher Write to USB Drive

7. You should now be able to start up your Raspberry Pi without having an SD card placed in it. The Raspberry Pi should automatically utilize your USB as the boot device.

Please note that it can take the Raspberry Pi ten to twenty seconds for it to pick up the USB device and begin the process of booting from it, so don’t be alarmed if you have longer boot times.

I hope this Raspberry Pi boot from USB tutorial has shown you how easy it is to set up your Raspberry Pi so that it can boot the operating system from a USB storage device instead of the Micro SD Card.

If you have any feedback on this guide on booting from a USB device, then feel free to post a comment below.


  1. Avatar for neo
    neo on

    Followed the instructions to the ‘T’ and booted from USB drive as advertised. Thank you Sir, love your site and youtube channel. Kudos to you for branching out and making Linux, Ubuntu Server and Python tutorials.

  2. Avatar for Charles
    Charles on

    What usb drives can you do this with?
    I did this exactly, but it didn’t work. I have a Monster Digital COLORS 16GB Usb 2.0, And A Raspberry Pi 3B. Do those work???

    1. Avatar for Emmet
      Emmet on

      Hi Charles,

      As far as I know most drives should work without any issues as long as it has sufficient size for the OS image.

      There are two possibilities that could be causing issues. One is that the drive is taking to long to start up, if the drive takes longer then 2 seconds to respond the Raspberry Pi will try to boot with the SD Card instead.

      Secondly is that some flash drives are very strict protocol requirement before it starts that isn’t handled by the Raspberry Pi’s boot loader. In that case you would need to use a different USB drive.

      It might not hurt to try using a different USB drive just to see if that works without any issues.

      Additionally, have you verified that the USB Boot mode has been enabled by using the following command.

      vcgencmd otp_dump | grep 17:

      You should get back the following result if it has been successfully enabled.



    2. Avatar for Bonzadog
      Bonzadog on

      Have a look in raspi-config and the boot options.

    3. Avatar for Charles
      Charles on

      Yup, Definitely A Usb Problem. The otp_dump returns the right result. I’ll Try With A Different Drive.

  3. Avatar for Jensen Lloyd
    Jensen Lloyd on

    could you use other operating systems to do this? I was thinking of putting an android os on there.

    1. Avatar for Emmet
      Emmet on

      Hi Jensen,

      I believe you should be able to. From memory the USB boot is programmed into the Pi’s own memory so it shouldn’t matter what OS is on the USB as long as it is supported by the Raspberry Pi’s hardware.


  4. Avatar for Marcelo
    Marcelo on

    After this change, I stil can use SD card for booting, just in case?

    1. Avatar for Emmet
      Emmet on

      Hi Marcelo,

      Yes you should stil be able to use your SD card for booting, the Raspberry Pi should automatically fall back to it.


  5. Avatar for Robert Acedia
    Robert Acedia on

    Why don’t they ship RPis with this setting on by default?

    Who wants to buy a sd card just to set this one setting?

    Everyone owns a flash drive … they are cheaper, faster & last longer.

    the sd card adds cost to the over all ownership of something ment to be inexpensive & available for low income children’s education … its a no brainier…

    1. Avatar for Emmet
      Emmet on

      Hi Robert,

      The Raspberry Pi foundation has actually started shipping Raspberry Pi’s with this enabled by default.

      The Raspberry Pi 3B+ and the Raspberry Pi 4 both have USB booting enabled right off the bat.


  6. Avatar for Bozo
    Bozo on

    This was a great tutorial and worked like a charm! I never knew RPI had made a hardware modification to allow this. I would suggest that anyone performing this get the fastest USB device they can for performance reasons.

  7. Avatar for NT
    NT on

    The USB device can be USB drive, I assume?

    1. Avatar for Emmet
      Emmet on

      Of course 🙂

Leave a Reply

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