Raspberry pi 3 boot from usb

As stated on the rPi website (see links below), the raspberry pi 3 has the possibility to boot directly from a mass storage device, such as an USB stick or hard drive and from network without the necessity of a microSD card installed.

I want to ask if anyone did this with Rasplex? If not, is there’s any possibility to update the Rasplex installer to write USB sticks compatible with this feature, considering it has to have an updated bootcode.bin (issued in the ‘next’ branch of rPi firmware) and a proper cmdline.txt (at the moment, the USB stick written with the Pi image of Rasplex contains a cmdline.txt that references the SD partition).



https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=155167

Background info:
I am building a case for the Pi and want to be able to switch usb sticks to switch software. The usb sticks will be in a kind of cartridge, so something like bootberry is not an option.

I don’t believe there are any immediate plans to intentionally add this functionality. But OpenPHT versions typically include the latest rPi firmware. You could always add it as a feature request to the github.

Is there an option to create this myself? I did manage to create an USB for retropie because thats based on raspbian. But don’t know how the handle this for rasplex.

Maybe you got a nice idea regarding my setup. I am using a NES as a media player. I want to switch cartridges to switch between retropie and rasplex. In the cartridge will be an USB stick. The old solution to boot of usb (with the sd card in) will also not work, as these OS use different boot files. (correct me if i’m wrong)

I just saw that the USB/PXE boot function is pushed to the master branch. So hope this will be included in the next build.

I also just found that a sd card with only a bootcode.bin will make an usb to boot. I will test this later today.

Wow, what a nice project

I like the idea of swapping cartridges for changing the function
hope you share some photos later

@thommy86 said:
I just saw that the USB/PXE boot function is pushed to the master branch. So hope this will be included in the next build.

I also just found that a sd card with only a bootcode.bin will make an usb to boot. I will test this later today.

https://www.raspberrypi.org/blog/pi-3-booting-part-i-usb-mass-storage-boot/

I’m not sure if that’s possible, but inquiring minds would like to know. :slight_smile:

I did some quick tests as I didn’t had a lot of time, but no luck so far! I will update when I can share more information.

@videotecaCNSU
You can find a picture on the hyperion forum. When my build is finished, I will make a post there in the showcase section. I am still waiting for a few parts.

edit: fix link

With the update to 1.8 this option is made available.

It is in fact possible to install RasPlex 1.8.0 to a USB drive and edit the setup in such a way that an RPi3 can boot from that USB drive without any SD card installed. But in order for such booting to work at all, whether for RasPlex or anything else, you first need to boot that RPi3 once with an SD card having a special directive added to the end of its “config.txt” file.
That directive line is as follows:
program_usb_boot_mode=1

The first time an RPi3 boots an SD card with such a directive, this will cause a permanent change of a ‘one-time-programmable’ bit in the hardware, giving it the ability to boot from USB. Once that has been done you no longer need to use SD cards, though you still can do so. The new boot procedure always looks for an SD card first, and only if no bootable SD card is present does it proceed to look for a bootable USB drive.

Installation of RasPlex to a USB drive can be done in the same way as you would install to an SD card.
Both the RasPlex Installer and the commonly used “Win32 Disk Imager” can be used to flash RasPlex to either an SD card or a removable USB drive. And the procedure for doing it is identical. Just make sure to choose the right drive.

However, in order for RasPlex to work properly when booted this way you also need to modify the “cmdline.txt” file after installing the RasPlex image to the USB drive. Normally that file specifies SD card partitions for use as boot partition and application data partition, and this naturally needs to be changed when using a USB drive instead. In editing the “cmdline.txt” file you simply replace its original single line with the text line shown below:
boot=/dev/sda1 disk=/dev/sda2 quiet

On the first boot of that USB drive RasPlex will create and resize the second partition mentioned in “cmdline.txt” for use by the embedded OpenPHT application in all future boot sessions (including the automatic reboot after this formatting).

The method described above can also be used for some other software than RasPlex, though it might not apply to all RPi software. eg: BerryBoot has its own different method for USB boot support, and does not use “cmdline.txt” the same way as RasPlex and some others do. But most software based on “LibreELEC” or “OpenELEC” should be compatible with the same methods as RasPlex.

Best regards: dlanor