Boot RPi from USB - Paalikatu/Hub GitHub Wiki
(Originally from https://www.dropbox.com/s/8lic2paygbcfp11/RUN%20RASPBIAN%20FROM%20USB.txt?dl=0)
Install RASPBIAN on a usb flash drive.
- Get the SD card that you are going to use for the boot section and format it FAT32.
- Rename the card "boot".
- Copy all of the files from the usb drive to root of sd card.
- Edit the cmdline.txt file On the SD card, change /dev/mmcblkp2 to /dev/sda2 and save the file.
(dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 rootwait text)
- Place both usb and sdcard in the pi and boot.
- Go through the setup and let the installation take place.
- After installtion is complete and your at the home screen open the terminal.
- sudo fdisk /dev/sda.
- Press p then enter, take note of what block sda2 starts with, mine was 133120.
- Press d then enter.
- Press 2 then enter, this will delete the second partition.
- Press n then enter, this will create the new partition process.
- Press p for primary partiton, than enter.
- Press 2, then enter.
- Now you will see the first sector, now type in the block number you took note of earlier mine was 133120 and hit enter.
- Now you will see the end sector, choose the default by pressing enter.
- Now type w then enter, this will write the partiton.
- You will see a message about the kernel yaddah yaddah, just ignore this. Now reboot the system.
- After the system reboots, open the terminal and type sudo resize2fs /dev/sda2 and press enter.
- After the resizing process run df -h to make sure it has resized.
- Run sudo blkid, locate /dev/sda2 and look for the uuid=with random numbers.
- Copy the uuid= with random numbers. sudo blkid | grep "sda2" | sudo tee -a /etc/fstab
- sudo nano /etc/fstab.
- Replace /dev/sda2 with the uuid you copied, and remove the " " if there are any. The line should look like this, UUID= AND WHAT EVER THE NUMBERS ARE the numbers are unique to the device, save the file.
- Reboot.
- After reboot check the file, cat /etc/fstab.
The universal unique identifier (UUID), is a unique number that the file systems table will identify during boot. This should take care of the booting issues while rebooting with another flash drive attached.