Just a quick message to say that I have successfully got USB boot working on my sole Raspberry Pi 3 using the following procedure. I'm adding it here in case anyone else is interested, as it was much easier than I thought it would be.
Note that this procedure uses a completely stock Raspbian Jessie Lite image. You only need to make one small change to the FAT16 partition before you boot your USB device on your chosen Pi 3.
Also bear in mind that this procedure permanently changes a setting inside the Raspberry Pi itself - in the actual BCM2837 SoC. It is not possible to undo this change!
1. Boot the Raspberry Pi 3 from an SD card running either Raspbian Jessie or Raspbian Jessie Lite. (Other distros may or may not work).
2. Update the OS and firmware on the card in the usual way by issuing the following command:
Code: Select all
sudo apt-get update && sudo apt-get upgrade
and saying 'yes' to whatever it offers you.
3. Add the following line to the bottom of the file /boot/config.txt:
4. Reboot the Pi. When the Pi boots back up from the SD card, upon seeing the line you just added, the firmware will program the One Time Programmable (OTP) memory inside the BCM2837 with a special flag that tells the on-chip boot ROM that on subsequent boots it should attempt to boot in USB host mode if booting from the SD card fails. Programming the One Time Programmable memory inside the BCM2837 is, as the name suggests ONE TIME ONLY. In other words - YOU CANNOT UNDO THIS STEP!
5. Power down the Pi.
5. On another computer, download the official Raspbian Jessie Lite image from the website (currently the 2017-03-02 release).
6. Write this image to your chosen USB mass storage device in exactly the same way you would write the image to an SD card.
7. Eject the USB device from your computer.
8. Re-insert the USB device to your computer. The first partition on the USB device is FAT16 and should be automatically mounted in whatever OS you are running on your machine.
9. On said FAT16 partition, fine the file cmdline.txt and edit it as follows: change the root= part to 'root=/dev/sda2', add 'rootwait' if it is not already specified, and remove the init=... part from the end.
10. Insert the USB drive as the only mass storage device on your Raspberry Pi 3. (This point is important, as you have just told it to boot from the first mass storage device using Linux's (sda). If you attach other mass storage devices, there is no guarantee your intended boot device will become the first one in the list.
11. Power up our Raspberry Pi 3 and wait. Wait some more while it tries, and fails, to mount /dev/mmcblk0p1 as /boot.
12. The Pi 3 will have booted into an emergency shell. Edit /etc/fstab to point to your USB mass storage device instead of mmcblk0.
13. Reboot. You will now have a fully working Raspbian Jessie Lite system running entirely off your USB mass storage device.
That's more steps than I thought it was, but never mind!
The key point is that, at least for Raspbian Jessie Lite, you don't need to make any changes to the ext4 partition before you boot from USB. The only change that needs to be made to the stock Raspbian Jessie Lite image is to change the command line passed to the Linux kernel on boot, which is contained in the file cmdline.txt on the boot partition, which is easily accessible from within Windows / OS X.
Once you have booted done the above initial setup, you can then modify the cmdline.txt to boot from the PARTUUID of the root partition on your USB mass storage device. You can also modify /etc/fstab to use the UUID of the boot and root filesystem instead of /dev/sda1 and /dev/sda2 as well.
Edited to add:
Resize the root partition with the following command:
Code: Select all
sudo parted /dev/sda resizepart 2 100%
To resize the root filesystem, use resize2fs.