Professional Documents
Culture Documents
Usb Boot
Usb Boot
A Raspberry Pi 3B+ has a native USB boot mode (this mode has to be manually enabled
by setting an OTP bit on a Raspberry Pi 3B). This native USB boot mode has serious
compatibility issues. A bootcode.bin file is available for older Raspberry Pi
models. Unfortunately, both of these approaches have serious limitations and once
working, can easily be broken by simply plugging in an additional USB storage
device.
The easiest and most reliable way to run Raspbian on a USB device with any
Raspberry Pi is to leave an SD card containing Raspbian in place, but use it only
for starting Raspbian that is residing on a USB device. While setting up such a
configuration is not rocket science, it can be confusing to a newcomer or someone
unfamiliar with Linux internals. In an effort to simplify the task, I've created
the attached script named 'usb-boot' to automate the process.
If 'No' is selected, the SD card will not be altered and the direct USB boot
capability of the Raspberry Pi 4 will be used.
[NOTE: The direct USB boot capability of the Raspberry Pi 4 requires an updated
bootloader and firmware:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_c
onfig.md]
If 'No' is selected, the SD card will not be altered, but booting the USB device
may be limited and/or unreliable as described above.
usb-boot then presents a list of available USB mass storage devices and prompts:
'Select the USB mass storage device to boot'
Use the arrow keys on your keyboard to navigate to the desired device and press the
spacebar to select it. Then use the tab key to navigate to the 'Ok' or 'Cancel'
button and press the return key.
Select 'No' if the USB device already has Raspbian on it and you wish to use it
(nothing will be copied).
Select 'Yes' if you want to copy the Raspbian on your SD card to the USB device
(everything will be copied).
If you select 'Yes', usb-boot will then prompt: 'Select the partition table type to
use (MBR = 2TB Maximum)'
usb-boot will then prompt: 'All existing data on USB device /dev/sdX will be
destroyed!' and ask: 'Do you wish to continue?'
If you select 'Yes', the copy will begin. The time required for this process will
depend on the amount of data on your SD card and the speed of your storage devices.
usb-boot will then complete the configuration process and warn you of any potential
conflicts it detects.
When usb-boot has finished, you should be able to reboot and be running Raspbian on
the USB device (first power off and remove the SD card if not using the SD card to
boot the USB device).
=====
sdc-boot provides a convenient way to select which attached device will be booted.
=====
GPT partition tables are necessary for devices whose size is over 2TB.
mbr2gpt converts an MBR partition table on a USB device to a GPT partition table,
as well as optionally expanding the ROOT partition and enabling booting via an SD
card.
mbr2gpt converts any size USB device, including SD cards placed in a USB adapter.
!!! DO NOT PROCEED UNLESS YOU HAVE A RELIABLE BACKUP OF THE DEVICE BEING
CONVERTED !!!
!!! INITIAL TESTING SHOULD BE PERFORMED ON A USB DEVICE CONTAINING EXPENDABLE
DATA !!!
mbr2gpt /dev/sdX
mbr2gpt will prompt for permission to perform the following optional functions:
=====