Prepare the SD Card & USB Stick/Drive
First install Raspbian on to both the SD Card and the USB stick as you normally would.
Boot Raspberry Pi
Insert both the SD Card and your USB stick into the Raspberry Pi and boot.
Configure SD Card for USB Boot
ssh into your Pi and execute the command
dmesg and look for identifying information associated with your USB stick. In most cases, you should find that your USB stick is at
/dev/sda with the text
Attached SCSI removable disk next to it.
Also, do the df -k command and you should see your USB stick at filesystem
/dev/sda2 with sda1 mounted at
Expand USB File System
Let’s expand the USB stick filesystem. First unmount the two volumes associated with the USB drive:
sudo umount /dev/sda1 sudo umount /dev/sda2
First update the file system table with fdisk:
sudo fdisk /dev/sda Command: p # note start of /dev/sda2 Command: d # delete 2 # partition 2 Command: n # new p # primary 2 # partition 2 131072 # start of /dev/sda2 from above Command: w # write changes
sudo resize2fs /dev/sda2
Modify SD Files & Reboot
/boot/cmdline.txt file and change
/etc/fstab file and change
After reboot enter
df -h and you should see your partition sizes with the expanded disk.
The time to boot into the GUI off of my USB stick was 20 seconds versus 33 seconds from the SD card!
I also updated my SD Card performance test with the results.