Backlit Keyboard in the dark

Boot your Raspberry Pi 3 from HDD

Do you start to get tired of the prospect that your SD card that you use in your Raspberry Pi 3 eventually will crash? If you have a spare HDD with a external cabinet and an unused USB-port in your Raspberry Pi you can avoid it by booting from the HDD instead.

By default the Raspberry Pi boots from the SD card, but if you have a Raspberry Pi 3 it’s possible to enable USB boot mode. Please note as this is done by setting a bit in the OTP (One Time Programmable). If you set the bit you cannot undo the operation. Have a look at BOOT FLOW in the Raspberry Pi documentation for further details and implications.

Still determined to boot from USB? Of course you are! You wouldn’t be visiting this page otherwise.

You must be running Raspbian or Raspbian Lite to be able to program the OTP bit so that you can boot from USB.

To start make sure that your Raspberry Pi 3 is updated.

$> sudo apt-get update
$> sudo apt-get upgrade

When the upgrades are finished prepare the programming of the OTP bit by adding a line to your /boot/config.txt. I executed echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt to add the line.

Verify that the line program_usb_boot_mode=1 has been added to the /boot/config.txt. Then a simple reboot will reprogram the OTP. You can reboot by running sudo reboot.

Check if the OTP has been programmed by issuing:

$> vcgencmd otp_dump | grep 17:
17:3020000a

If the output for 17 is 0x3020000a the boot mode in the OTP has been changed, if not the bit has not been successfully programmed. Remember to remove the added line to the /boot/config.txt so that you don’t accidentally reprogram another Raspberry Pi to boot from USB by reusing the SD card in another device.

Now you can boot your Raspberry Pi from an USB HDD if you have the appropriate OS installed on the USB HDD.

 2017-11-24  2 minutes