Booting Raspberry Pi 3 B With a USB Drive

Introduction: Booting Raspberry Pi 3 B With a USB Drive

About: A kid with two arms, two legs, a nose, a head and a torso!!!

The Raspberry Pi 3 B can be booted with a compatible thumb drive without spending any money!

Note: The Raspberry Pi 3 B+ can be USB booted out-of-the-box.

Step 1: Boot Your Pi on the SD!

The Raspberry Pi 3 B+ is able to boot from USB without any changes, but the Raspberry Pi 3 requires the USB boot bit to be set in the OTP (one-time programmmble).

To enable the USB boot bit, the Raspberry Pi 3 needs to be booted from an SD card with a config option to enable USB boot mode. Once this bit has been set, the SD card is no longer required. Note that any change you make to the OTP is permanent and cannot be undone.

You can use any SD card running Raspbian or Raspbian Lite to program the OTP bit. First, prepare the /boot directory with up to date boot files:-

 sudo apt update && sudo apt upgrade && sudo reboot

Then enable USB boot mode with this code:-

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

This adds program_usb_boot_mode=1 to the end of /boot/config.txt. Reboot the Raspberry Pi with:-

sudo reboot

Then check that the OTP has been programmed with:-

 vcgencmd otp_dump | grep 17:

Check that the output 17:3020000a is shown. If it is not, then the OTP bit has not been successfully programmed. In this case, go through the programming procedure again. If the bit is still not set, this may indicate a fault in the Pi hardware itself.

If you wish, you can remove the 'program_usb_boot_mode' line from config.txt, so that if you put the SD card in another Raspberry Pi, it won't program USB boot mode. Make sure there is no blank line at the end of config.txt. You can edit config.txt using the nano editor using the command:-

sudo nano /boot/config.txt              # then scroll all the way to the bottom

Step 2: After Reboot...

Now we need get a compatible USB drive that can be used to boot the Pi!

I am using a Buffalo RUF3-KS Drive because it's fast and cheap....Most of the Verbatim Drives don't work!

We now need to burn an .img to the usb drive(replace 'X' with your Storage):-

sudo dd if=/dev/sdX of="/path/to/image.img"
Do this carefully you can really screw up your computer!

Now you can shutdown your system:-

sudo shutdown now

Step 3: Booting It Up!!

Now you can remove your SD card....

After you have removed your SD card....insert the USB Drive in a USB port and power it up!

Be the First to Share

    Recommendations

    • Make it Glow Contest

      Make it Glow Contest
    • First Time Author Contest

      First Time Author Contest
    • PCB Challenge

      PCB Challenge

    9 Discussions

    0
    Dan1jel
    Dan1jel

    2 months ago

    I destroyed both of my computers hard drives. Took me a while but the correct command should be:

    sudo dd if=/path/to/image.img of=/dev/sdX

    0
    prabbit237
    prabbit237

    Reply 4 days ago

    Yes, you are absolutely right that the if and of are backwards.

    However, that shouldn't have damaged your drives in any way. All it would have done was filled them up with a *HUGE* image file until it ran out of free space and aborted. Deleting the file would have then restored the free space again.

    0
    Dan1jel
    Dan1jel

    Reply 3 days ago

    It maybe shouldn't but the all files wore corrupt afterwards. Just wanted to point it out so other maybe could see that comment or maybe the Author could change the content.

    1
    MattiV
    MattiV

    1 year ago

    We now need to burn an .img to the usb drive(replace 'X' with your Storage):-
    sudo dd if=/dev/sdX of="/path/to/image.img"

    how and were i see what i have usb harddisk connected and what is name, maybe somethink sda1,2,3,4,5, or what must be have ?
    0
    csogm54
    csogm54

    Reply 1 year ago

    HI
    I think if (input filter ) and of (output filter) are inverted if you want to put the image on se sd card.

    0
    Dan1jel
    Dan1jel

    Reply 2 months ago

    Yes took me a while to notice this, thnx Lord_vek for destroying my computer (both of them)

    Correct command is: sudo dd if=/path/to/image.img of=/dev/sdX

    Please update this asap or remove your text "be careful this could damage your computer" text.

    0
    Lord_Vek
    Lord_Vek

    1 year ago

    OK, thanks for your answer!

    0
    Lord_Vek
    Lord_Vek

    Question 2 years ago on Step 3

    Yes, but after you program the OTP bit, can you still be able to also boot from an SD card again ?

    1
    JustinC186
    JustinC186

    Answer 1 year ago

    Yes, because when you reboot after setting the command it still boots off the SD card. If there is no SD card installed it will boot from an attached USB drive (if bootable). If you want to switch back to an SD card just remove the USB drive and reinstall the SD card.