Monday, July 4, 2016

Boot from USB

All Raspberry Pi models (from old A up to 3) are intended to boot from the SD/microSD slot. Period. With microSD cards of 16 GB or 32 GB there should be no space problems for most applications. However, what if you want to use a USB stick or a removable hard disk (imagine 1TB or even 2TB!) as the boot device?.
Fortunately, it's possible to boot from a USB disk although you'll still need a SD/microSD card inserted in the slot. Obviously need to format/copy all required files into the partition in the USB disk/stick. In addition, and here's the magic, change the default boot path to instruct RPi to boot from the USB drive. Edit the file cmdline.txt from the FAT partition on the SD card, and change the line:
root=/dev/mmcblk0p2
to read like this:
root=/dev/sdaX
where sdaX is the proper partition from your USB drive (i.e. sda2).
Now reboot your Raspberry Pi, which will briefly boot from the SD/microSD card, and then switch to the USB drive to fully complete the boot sequence from it

No comments:

Post a Comment