RaspberryPi Boot from USB

pi-model-plus

[01.11.2015] Succeeded in converting my RaspberryPi to mount an ext4 /root filesystem on a USB Flash Drive instead of the microSD card ( normal Pi boot location ). Process was actually quite simple. I will outline the entire process from Blank uSD and USB to working.

RASPBIAN Debian Wheezy Version:December 2014 Release date:2014-12-24
Kernel version:3.12

Step-1) Download latest Raspian *.IMG file from http://www.raspberrypi.org/downloads/

Step-2) Use Win32DiskImager on Windows PC to write IMG file to uSD card.

Step-3) Boot the Pi ( it needs to expand the new filesystem on the uSD ). Go through the normal raspi-config process for timezone, etc.

Step-4) Reverse Step-2 on Windows7 and create new IMG file from reading the uSD. This is now a personalized version of Raspian you can use for USB or uSD.

Step-5) Write the new IMG file to USB stick. This will copy both the boot ( FAT ) and the root ( EXT4 ) partitions to USB. Pi will only use the EXT4 partition from USB.

Step-6) On Windows, edit uSD card file cmdline.txt from the boot ( FAT ) partition.

From: root=/dev/mmcblk0p2   ( the uSD )

To: root=/dev/sda2  ( the USB )

That is it.  When the Pi boots, it will ignore the old ext4 root filesystem on /dev/mmcblk0p2 and use /dev/sda2 instead.  I had 2 goals in doing this process, goal-1 was to put the filesystem on a more robust media than uSD. I have had bad experience with corrupted filesystems on SDs on Pi’s in the past from improper power removal without shutdown.  Goal-2 was faster boot times. Sadly, my boot times were unchanged at 30s to text login for both uSD and USB. I purchased the fastest USB flash media I could find ( SanDisk USB 3.0 16GB for $11 ) – thinking that even though the Pi is USB 2.0, the flash access ( latency, etc ) would be faster.  I suspect the Linux boot process executed on the 700 MHz ARM is the actual bottleneck.

Good info here on Pi boot process

Advertisements
RaspberryPi Boot from USB

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s