Running RasPBX from an External USB HDD or Thumb Drive

It is possible to have the root partition on an external USB drive and run RasPBX from there. This has 2 advantages: 1. Faster speed. HDDs (and also SSDs of course) are much faster than SD cards. 2. Higher reliability. The number of writes per sector of an SD card is limited, HDDs instead are much more reliable.
When using an HDD, it has to have it’s own power supply. The BBB’s USB port is not strong enough to power a hard drive on its own.
Thumb drives are not really more reliable than SD cards, there is not much gained using them instead of SD cards reliability wise. But it can still be useful having the root partition on a thumb drive and the procedure is identical to HDDs anyway, so they are covered here, too.

Step 1: Copy the SD card back to an image file

Assuming you have already installed and configured everything on your SD card, and you want to move this over to the USB drive now. You can skip this step and continue with step 2 if you have nothing configured yet or want to start from scratch again.
On Windows, insert the SD card into your reader and start Win32 Disk Imager. Copy the whole SD card to an image file on your hard drive. On MAC and Linux, run this command on the console:

sudo dd bs=1M if=/dev/sdX of=./backup.img

Replace /dev/sdX in the command above with the actual device of your card reader. Run sudo fdisk -l to get a list of all disks on your system.

Step 2: Copy the image file to your USB drive

Now copy the image file to the external USB HDD or thumb drive. With this step you are deleting all data on your drive, no matter how large it is! If you have skipped step 1, use the original RasPBX image file instead of the backup image file from step 1. On Windows, use Win32 Disk Imager again, select the image file as source and the USB drive as destination. On MAC/Linux, the command (for your own file saved with step 1) is:

sudo dd bs=1M if=./backup.img of=/dev/sdX

In case you are using the original image use this command instead:

xz -dc raspbx-bbb-*.img.xz > /dev/sdX

Replace /dev/sdX in the command above with the actual device of your USB drive. Watch out with this step! Don’t use the wrong /dev/sdX as you might accidentally erase one of your computer’s hard drives. Better double and triple check this step to make sure you are really writing to the right device.
The USB drive has to be large enough, it has to have 2GB or more if the original RasPBX image file is used or at least the size of the SD card you’ve been using before.

Step 3: Create an SD card for booting

The BBB still needs an SD card to boot from, but only to load boot loader and kernel, everything else runs off the external drive. You can use the SD card you’ve been using before to run RasPBX and in this case directly continue with step 4. Or create a new card, which doesn’t need to be large or fast, even an old one with only 64MB is sufficient. If the card is already formatted with a FAT32 partition (as all cards are off the shelf) then just delete all files on this card and copy over the files from the first partition of the USB drive created in step 2. On Windows this is easy, as you will only see the FAT partition of this device. Just copy the files on this drive over to the SD card. On MAC/Linux mount the first partition of the USB drive (sized 75MB) and copy the files from there.

Step 4: Configure the BBB to use the external root partition

Now locate the file uEnv.txt on the SD card used for booting (not to confuse with the USB drive). On a booted BBB this file is located in /boot/uboot/uEnv.txt . Edit this file in any text editor, and locate the line

mmcroot=/dev/mmcblk0p2 ro

Replace this with

mmcroot=/dev/sda2 ro

Now insert the SD card and plug your USB drive into the BBB. It will boot as usual if everything was done properly.