A shell script for configuring an external USB drive as root filesystem on a Raspberry Pi running Raspbian. It's a companion to Using an External Drive as a Raspberry Pi Root Filesystem, which you should read first.
First, read the tutorial.
On a Raspberry Pi running Raspbian, with a USB-connected storage device you wish to use for your root filesystem:
git clone [email protected]:adafruit/Adafruit-Pi-ExternalRoot-Helper.git
cd Adafruit-Pi-ExternalRoot-Helper
sudo ./adafruit-pi-externalroot-helper -d /dev/sda
...where /dev/sda
is the external USB you wish to use for a root filesystem.
This script is mostly an implementation of the process outlined in paulv's HOWTO: Move the filesystem to a USB stick on the Raspberry Pi forums, with additional help from the following sources:
- The Arch Linux wiki, GUID Partition Table for what a GPT is and
some
parted
commands. - GUID Partition Table, Wikipedia
- Booting from an external USB drive, from the Raspberry Pi StackExchange.
- Booting a Raspberry Pi reliably from USB in the presence of multiple USB drives, by Stefan Krastanov.
- Speed up your Pi by booting to a USB flash drive, by Sam Hobbs.
- This comment on
root=
ininit/do_mounts.c
in the Linux source tree.
Along with manual / info pages for: