Démarrer la Raspberry Pi sur clef USB.

Raspberry Pi, how to boot from a USB key or an external hard drive.

Updated the 2 May 2019 - 0 Comments - , , , ,

ⓘ This article may have been partially or fully translated using automatic tools. We apologize for any errors this may cause.

Please note, the Raspberry Pi 4 does not yet support USB booting. The function should be added soon.

As you know, the Raspberry Pi uses a micro SD card instead of a hard drive. It's handy in terms of size and price, but SD cards end up getting damaged by multiple read and write operations.

To limit wear and tear on your SD card, a simple solution is to configure your Raspberry Pi to boot from a USB storage device, whether it is a key or a hard drive.

In this tutorial, we will therefore see in a few minutes how to boot your Raspberry Pi on a USB key or an external hard drive.

The necessary material

To perform this operation, you will need the following equipment (click on a link to see its price at Amazon):

Allow the Raspberry Pi to boot from a USB key

Note, for the Raspberry Pi 3B +, you do not need to perform the operations below, simply install Raspbian on your USB device, inserted into the Pi without the MicroSD card, it will be detected automatically.

Now that you have all the necessary hardware, you will need to start by installing Raspbian on your SD card. For this, we refer you to our article to install Raspbian from Windows, or from Linux.

Raspbian installed on your microSD card, repeat the operation, this time installing Raspbian on your USB key / hard drive. When finished, unplug the USB key / hard drive.

Once the two installations are complete, connect the SD card to your PC and go to the partition boot from the map (the only one accessible from Windows, normally) to edit the file config.txt and add the following line at the end of the file:

program_usb_boot_mode=1

Save the file, then insert the micro SD card into your Raspberry Pi and start it (insert only the SD card, not the USB key / hard drive). Normally once started, the Raspberry Pi will automatically configure itself to start on the USB key in the future.

To check that everything is good, you can look at register 17 of the OPT (programmable One-Time which designates the read only memory which can only be programmed once). For that we use the following command:

vcgencmd otp_dump | grep 17

The Raspberry Pi must return to us: 17: 3020000a. If this is not the case, it is because you have performed a previous step incorrectly and you must start the creation of the map again.

You can now turn off your Raspberry Pi, take out your micro SD card and insert your USB key / hard drive with Raspbian installed.

All you have to do is plug in your Raspberry Pi, the startup will take a few seconds, and that's it, your Raspberry Pi will boot from your USB key!

Share
Newsletter
Author:
Raspberry Pi FR
Join the Raspberry Pi community
A $35 computer already sold 10 million copies
BUY THE NEW RASPBERRY PI 4
Related tutorials
Create a Wi-Fi hotspot in less than 10 minutes with Pi Raspberry! Install Android on his Raspberry Pi How to install a web server on the Raspberry Pi (Apache + PHP + MySQL) Create a NAS with your Raspberry Pi and Samba How to recover the password of your Raspberry Pi if you lost it. 2018 Update.
No Comments
Share
Newsletter Sign-Up
Subscribe to the newsletter.
¿Te gustó este artículo?
¡Suscríbete y mantente informado!