RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Running Raspbian from USB Devices : Made Easy

Fri Nov 03, 2017 8:11 am

NOTE: usb-boot as been updated to allow the use of direct USB booting on the Raspberry Pi 4 (in addition to hybrid SD/USB booting on all Raspberry Pi models). usb-boot also allows Raspberry Pi 4 users to migrate their SD card based systems to a USB device.

A recurring topic of discussion is how to configure and reliably run Raspbian on a USB flash drive, USB hard drive, or USB SSD instead of an SD card.

A Raspberry Pi 3B+ has a native USB boot mode (this mode has to be manually enabled by setting an OTP bit on a Raspberry Pi 3B). This native USB boot mode has serious compatibility issues. A bootcode.bin file is available for older Raspberry Pi models. Unfortunately, both of these approaches have serious limitations and once working, can easily be broken by simply plugging in an additional USB storage device.

The easiest and most reliable way to run Raspbian on a USB device with any Raspberry Pi is to leave an SD card containing Raspbian in place, but use it only for starting Raspbian that is residing on a USB device. While setting up such a configuration is not rocket science, it can be confusing to a newcomer or someone unfamiliar with Linux internals. In an effort to simplify the task, I've created the attached script named 'usb-boot' to automate the process.

If usb-boot is running on a Raspberry Pi 4, usb-boot first prompts: 'Use SD card to boot the USB device?'

If 'No' is selected, the SD card will not be altered and the direct USB boot capability of the Raspberry Pi 4 will be used.

[NOTE: The direct USB boot capability of the Raspberry Pi 4 requires an updated bootloader and firmware: Raspberry Pi EEPROM Manager]

If usb-boot is running on a Raspberry Pi 3B+ or a Raspberry Pi 3B with its OTP bit set, usb-boot first prompts: 'Use SD card to boot the USB device (recommended)?'

If 'No' is selected, the SD card will not be altered, but booting the USB device may be limited and/or unreliable as described above.

usb-boot then presents a list of available USB mass storage devices and prompts: 'Select the USB mass storage device to boot'

Use the arrow keys on your keyboard to navigate to the desired device and press the spacebar to select it. Then use the tab key to navigate to the 'Ok' or 'Cancel' button and press the return key.

usb-boot will then prompt: 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX?'

/dev/mmcblk0 is the SD card and /dev/sdX is the USB device.

Select 'No' if the USB device already has Raspbian on it and you wish to use it (nothing will be copied).

Select 'Yes' if you want to copy the Raspbian on your SD card to the USB device (everything will be copied).

If you select 'Yes', usb-boot will then prompt: 'Select the partition table type to use (MBR = 2TB Maximum)'

usb-boot will then prompt: 'All existing data on USB device /dev/sdX will be destroyed!' and ask: 'Do you wish to continue?'

If you select 'Yes', the copy will begin. The time required for this process will depend on the amount of data on your SD card and the speed of your storage devices.

usb-boot will then complete the configuration process and warn you of any potential conflicts it detects.

When usb-boot has finished, you should be able to reboot and be running Raspbian on the USB device (first power off and remove the SD card if not using the SD card to boot the USB device).

=====

sdc-boot provides a convenient way to select which attached device will be booted.

Usage syntax is:

sdc-boot [ /dev/sdX2 | /dev/mmcblk0p2 | hhhhhhhh-02 | hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh ]

/dev/sdX2 is a USB device

/dev/mmcblk0p2 is the SD card

hhhhhhhh-02 | hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh is a device identified by its PARTUUID

If no device is specified, the currently selected boot device will be displayed.

=====

GPT partition tables are necessary for devices whose size is over 2TB.

mbr2gpt converts an MBR partition table on a USB device to a GPT partition table, as well as optionally expanding the ROOT partition and enabling booting via an SD card.
mbr2gpt converts any size USB device, including SD cards placed in a USB adapter.

!!! DO NOT PROCEED UNLESS YOU HAVE A RELIABLE BACKUP OF THE DEVICE BEING CONVERTED !!!
!!! INITIAL TESTING SHOULD BE PERFORMED ON A USB DEVICE CONTAINING EXPENDABLE DATA !!!

Usage syntax is:

mbr2gpt /dev/sdX

mbr2gpt will prompt for permission to perform the following optional functions:

1. Convert the USB device to use GPT partition tables

2. Expand the ROOT partition to use all available space

3. Set the SD card to boot the USB device

=====

set-partuuid displays or changes the ROOT partition PARTUUID on a device.

Usage syntax is:

set-partuuid device [ hhhhhhhh-02 | hhhhhhhh-hhhh-hhhh-hhhh-hhhhhhhhhhhh | random ]

device may be /dev/sdX2 or /dev/mmcblk0p2

If no partuuid is specified, the current ROOT partition PARTUUID will be displayed.
Attachments
usb-boot.zip
(10.52 KiB) Downloaded 2517 times
Last edited by RonR on Mon Feb 28, 2022 1:34 am, edited 23 times in total.

User avatar
HawaiianPi
Posts: 7745
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 5:32 pm

RonR wrote:
Fri Nov 03, 2017 8:11 am
A Raspberry Pi 3 has a USB boot mode that has to be permanently enabled by setting an OTP bit. A bootcode.bin file is available for all Raspberry Pi models. Unfortunately, both of these approaches have serious limitations and once working, can easily be broken by simply plugging in an additional USB storage device.
Only true for bootcode.bin, as it simply checks the first USB storage device it finds. Pure USB boot works fine with multiple USB storage devices attached. I have done it and had no problems booting with an extra flash drive attached. My issue with pure USB boot was that restart and shutdown were unreliable (regardless of the number of USB storage devices).

So I agree that keeping /boot on the SD card is the most versatile and reliable way to do it, and have posted that very same sentiment many times.
RonR wrote:
Fri Nov 03, 2017 8:11 am
A Raspberry Pi 3 has a USB boot mode that has to be permanently enabled by setting an OTP bit.
I'd just like to point out that setting the OTP USB boot bit has no permanent effect on the operation of the Pi3. There seems to some FUD that setting the OTP bit somehow changes the way you must use your Pi3, but that's not true. The Pi3 will default to booting from an SD card even with that bit set, so setting the bit does not REQUIRE you to boot from USB, it only enables it. If you want to experiment with USB boot, then go right ahead and set the bit, and if you find that USB boot does not suit your needs, then just insert a boot SD card and your Pi3 will boot from it exactly like it did before. USB boot does work for some people, I'm just not one of them. It all depends on your USB boot device. Some work, some don't.

And since you made a script to simplify the process, perhaps this should be in the beginners forum.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 6:30 pm

HawaiianPi wrote:
Fri Nov 03, 2017 5:32 pm
Only true for bootcode.bin, as it simply checks the first USB storage device it finds. Pure USB boot works fine with multiple USB storage devices attached. I have done it and had no problems booting with an extra flash drive attached. My issue with pure USB boot was that restart and shutdown were unreliable (regardless of the number of USB storage devices).
I suspect you were lucky in that the desired USB storage device happened to be the first one to come ready and therefore booted successfully. If some other bootable USB device had come ready first, it would have booted instead since the 'Pure USB boot' has no idea which of your multiple devices is the desired one. If the first one to come ready is not configured properly for booting, I'd bet things would hang.

User avatar
rpdom
Posts: 21837
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 7:35 pm

RonR wrote:
Fri Nov 03, 2017 6:30 pm
I suspect you were lucky in that the desired USB storage device happened to be the first one to come ready and therefore booted successfully. If some other bootable USB device had come ready first, it would have booted instead since the 'Pure USB boot' has no idea which of your multiple devices is the desired one. If the first one to come ready is not configured properly for booting, I'd bet things would hang.
I believe "bootable" in this case means "is a FATxx partition with a bootcode.bin file in it".

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 7:59 pm

rpdom wrote:
Fri Nov 03, 2017 7:35 pm
RonR wrote:
Fri Nov 03, 2017 6:30 pm
I suspect you were lucky in that the desired USB storage device happened to be the first one to come ready and therefore booted successfully. If some other bootable USB device had come ready first, it would have booted instead since the 'Pure USB boot' has no idea which of your multiple devices is the desired one. If the first one to come ready is not configured properly for booting, I'd bet things would hang.
I believe "bootable" in this case means "is a FATxx partition with a bootcode.bin file in it".
I'm not sure what your point is, but I do know that the 'standalone' bootcode.bin fails when the first USB storage device to come ready is anything other than a properly configured boot device. For example, if the first device to come ready is a USB flash drive with a single partition formatted NTFS, your system won't boot until you remove that USB flash drive. I'd be very surprised if the RPi-3 OTP boot is any smarter.

User avatar
HawaiianPi
Posts: 7745
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 8:08 pm

RonR wrote:
Fri Nov 03, 2017 7:59 pm
I'm not sure what your point is, but I do know that the 'standalone' bootcode.bin fails when the first USB storage device to come ready is anything other than a properly configured boot device. For example, if the first device to come ready is a USB flash drive with a single partition formatted NTFS, your system won't boot until you remove that USB flash drive. I'd be very surprised if the RPi-3 OTP boot is any smarter.
When I was testing USB boot I had an SSD and a USB flash drive connected. I booted the system dozens of times and it never failed to boot from the SSD, but the USB flash drive was almost always mounted as /dev/sda1, so it would seem that the SoC boot code is a bit smarter. My flash drive was even formatted FAT32, it just didn't have any boot code.

On the other hand, an SD card with bootcode.bin failed to boot every time with the flash drive and SSD connected.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 9:06 pm

HawaiianPi wrote:
Fri Nov 03, 2017 8:08 pm
When I was testing USB boot I had an SSD and a USB flash drive connected. I booted the system dozens of times and it never failed to boot from the SSD, but the USB flash drive was almost always mounted as /dev/sda1, so it would seem that the SoC boot code is a bit smarter. My flash drive was even formatted FAT32, it just didn't have any boot code.

On the other hand, an SD card with bootcode.bin failed to boot every time with the flash drive and SSD connected.
Even if the SoC boot code is a bit smarter and can skip over certain non-bootable storage devices, you still don't have any control over which bootable device is booted (presumably it's the first one to come ready, not necessarily the one you want booted).
HawaiianPi wrote:
Fri Nov 03, 2017 5:32 pm
My issue with pure USB boot was that restart and shutdown were unreliable (regardless of the number of USB storage devices).
It's unclear to me why you're defending a method that you've found to be seriously flawed. This discussion appears to be of little value when the tried and proven method of keeping an SD in place is 100% reliable and provides full control over which USB device is booted. A dirt-cheap 4GB SD card is all that's needed and since there will be no writes to it, it's likely to last forever. Yes, you can get by with a smaller SD card if you whittle things down to just the boot partition, but it's hardly worth all the effort. Plus, if you have a problem with your USB device, you've got a bootable system on the SD card that you can quickly and easily press into service for troubleshooting purposes.

User avatar
rpdom
Posts: 21837
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 9:12 pm

RonR wrote:
Fri Nov 03, 2017 9:06 pm
Even if the SoC boot code is a bit smarter and can skip over certain non-bootable storage devices, you still don't have any control over which bootable device is booted (presumably it's the first one to come ready, not necessarily the one you want booted).
I'm wondering why you think people may have multiple "bootable" devices connected and what you class as "bootable" anyway.

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Fri Nov 03, 2017 9:37 pm

rpdom wrote:
Fri Nov 03, 2017 9:12 pm
[I'm wondering why you think people may have multiple "bootable" devices connected and what you class as "bootable" anyway.
Simply writing a Raspbian image to a USB device makes it a bootable device. Having multiple bootable USB flash drives is probably not at all uncommon. Plugging more than one of them in at a time to copy files or customize configurations should not cause a failure to boot or boot the wrong device unless/until you remove them.

Why would you build and configure a system in a manner that's unreliable and/or unpredictable under perfectly reasonable conditions? It's just as easy to do it such that you avoid all the confusion, failures, and frustration.

k-pi
Posts: 929
Joined: Sun Feb 12, 2017 1:46 pm
Location: Upper Hale, Surrey, UK.

Re: Running Raspbian on USB Devices : Made Easy

Sat Nov 04, 2017 12:46 pm

I've not had any problems booting from pendrives, since setting that OTP bit on my RPi3.

I really don't understand why you would have multiple boot devices connected at any one time, it makes no sense at all.

If I want to use a different OS, I just power off, change pendrive & restart, it's as simple as that.

Also, when using a powered USB hub as the power supply for my RPi3 & an external HDD, it's the same, just power off, change OS pendrive, restart.

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Sat Nov 04, 2017 9:41 pm

k-pi wrote:
Sat Nov 04, 2017 12:46 pm
I've not had any problems booting from pendrives, since setting that OTP bit on my RPi3.

I really don't understand why you would have multiple boot devices connected at any one time, it makes no sense at all.

If I want to use a different OS, I just power off, change pendrive & restart, it's as simple as that.

Also, when using a powered USB hub as the power supply for my RPi3 & an external HDD, it's the same, just power off, change OS pendrive, restart.
If you have a rule that you will never ever for any reason plug in a second one of those pen drives that has Raspbian or another O/S on it, then you might not have any problems. But if you reboot without first removing that additional pen drive, there's an excellent chance that your RPi will boot the wrong one or not boot at all. I frequently have a need to plug in an additional pen drive that just happens to have Raspbian on it. I don't want to have to worry that if I forget to remove it before rebooting, my system might boot the wrong device or not boot at all. My only point is I don't care to have such a limitation and vulnerability when I can just as easily have a system that does the right thing no matter how many additional devices (bootable or not) I plug in.

If there were some huge savings or other benefit for abandoning a method that's 100% reliable and predictable for one that's seriously limited and flawed, I'd understand the argument. But to introduce potential problems without a good reason makes no sense to me. It's obviously a personal choice, and I choose reliability and predictability.

User avatar
HawaiianPi
Posts: 7745
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Running Raspbian on USB Devices : Made Easy

Sun Nov 05, 2017 9:25 am

Pi3 USB boot is a bit picky about the device it's booting from. Not everyone has the problems I had. It works fine for some people. However, I did say that I agreed with you that keeping /boot on the SD card was the most versatile and reliable way, since it works with every Pi model and should work with any bootable USB device (and if you use UUID or PARTUUID it will always boot from the correct device, no matter what else is connected).

I don't agree that having more than 1 bootable device connected is common (or not at all uncommon, as you put it). I suspect it's exceedingly rare, actually. But if you have a need for it, then yes, keeping /boot on the SD card is the way to go, and your script would be a handy way to switch boot devices.

You seem awfully sensitive to criticism. There's an old saying, you can't please everyone, so don't sweat the nay-sayers. I'm sure someone will find your script useful.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

BetterWang
Posts: 25
Joined: Fri Oct 27, 2017 4:16 am

Re: Running Raspbian on USB Devices : Made Easy

Mon Nov 06, 2017 12:55 am

HawaiianPi wrote:
Fri Nov 03, 2017 8:08 pm
RonR wrote:
Fri Nov 03, 2017 7:59 pm
I'm not sure what your point is, but I do know that the 'standalone' bootcode.bin fails when the first USB storage device to come ready is anything other than a properly configured boot device. For example, if the first device to come ready is a USB flash drive with a single partition formatted NTFS, your system won't boot until you remove that USB flash drive. I'd be very surprised if the RPi-3 OTP boot is any smarter.
When I was testing USB boot I had an SSD and a USB flash drive connected. I booted the system dozens of times and it never failed to boot from the SSD, but the USB flash drive was almost always mounted as /dev/sda1, so it would seem that the SoC boot code is a bit smarter. My flash drive was even formatted FAT32, it just didn't have any boot code.

On the other hand, an SD card with bootcode.bin failed to boot every time with the flash drive and SSD connected.
If you have working OS installed on both USB devices, which one will be booted?
Is it predictable?
What if you swap the USB port, would the booting order swapped as well?

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Mon Nov 06, 2017 1:02 am

BetterWang wrote:
Mon Nov 06, 2017 12:55 am
If you have working OS installed on both USB devices, which one will be booted?
Is it predictable?
What if you swap the USB port, would the booting order swapped as well?
If you use the usb-boot script, it won't matter how many USB devices have a working (or non-working) OS on them and you will always boot the one you selected with usb-boot, regardless of the USB port things are plugged into.
Last edited by RonR on Mon Nov 06, 2017 10:36 pm, edited 1 time in total.

User avatar
HawaiianPi
Posts: 7745
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Running Raspbian on USB Devices : Made Easy

Mon Nov 06, 2017 4:11 am

BetterWang wrote:
Mon Nov 06, 2017 12:55 am
If you have working OS installed on both USB devices, which one will be booted?
Is it predictable?
What if you swap the USB port, would the booting order swapped as well?
It would not be 100% predictable. The majority of the time my system boots with the flash drive as /dev/sda and the SSD as /dev/sdb, but on the odd occasion they flip. I suspect that swapping ports would not matter, as it's likely the flash drive is simply "ready" before the SSD drive, so it gets detected first. The SSD drive is not connected directly to USB like the flash drive, it is a SATA device on a SATA-to-USB converter, which may affect the time it takes to be seen by the USB ports. However, the difference must be small enough that the SSD does pop up first occasionally.

It should be possible to create some kind of bootloader, but it would need to be installed on each device, and it all gets way more complicated than just having an SD card which tells the system exactly which device to boot (ideally the bootloader would be on the SD card).

Such bootloaders are common in the world of Linux outside of Raspbian. Most of my x86 computers boot into GRUB (the GRand Unified Boot-loader) that allows me to choose which OS to boot. The machine I'm typing this reply on has Windows 10 and two different flavors of Linux (Mint and Slackware).

In our little ARM corner of the Linux word there is NOOBS and Berryboot, of which only the latter is a true bootloader, and it's supposed to be able to work with USB devices, but I have no experience with Berryboot myself.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

GGEZ
Posts: 6
Joined: Mon May 15, 2017 10:54 pm

Re: Running Raspbian on USB Devices : Made Easy

Sat Dec 09, 2017 9:00 pm

This method screws up raspi-config. I had to take out the SD card and edit config.txt on my computer. Still not sure how to use raspi-config. It caused me hours of frustration + 1 week of thinking to fix the downstream problem this caused. :evil:

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Sat Dec 09, 2017 9:15 pm

GGEZ wrote:
Sat Dec 09, 2017 9:00 pm
This method screws up raspi-config. I had to take out the SD card and edit config.txt on my computer. Still not sure how to use raspi-config.
Your problem is not related to the usb-boot script provided in this topic.

raspi-config does not know how to resize Raspbian when it's running from a USB drive, regardess of the method used to put Raspbian on a USB drive.

The attached fix-rc archive (download/file.php?id=19959) contains two solutions to this problem:

1. raspi-config-usb makes a temporary copy of raspi-config, patches it to work, runs the temporary copy, then deletes the temporary copy.

2. patch-rc copies raspi-config to raspi-config-original and patches raspi-config to work.

fbe
Posts: 704
Joined: Thu Aug 17, 2017 9:08 pm

Re: Running Raspbian on USB Devices : Made Easy

Sun Feb 18, 2018 9:04 pm

RonR wrote:
Sat Dec 09, 2017 9:15 pm
Your problem is not related to the usb-boot script provided in this topic.
Some settings in raspi-config are stored in /boot/config.txt and your script configures the Pi to mount the first partition on the USB device to /boot. If the system boots from SD card (and this happens if you leave it in your Pi) changes by raspi-config to /boot/config.txt will be ignored.

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Mon Feb 19, 2018 11:45 pm

usb-boot (usb-boot.zip attached to the first message in this topic) has been updated.

usb-boot now mounts the BOOT partition of the SD card (/dev/mmcblk0p1) on /boot instead of the BOOT partition of the USB device (/dev/sdX1).

If you used the original version of usb-boot, you may find it beneficial to modify the /boot line of the /etc/fstab file on your USB device to the following:

Code: Select all

/dev/mmcblk0p1        /boot           vfat    defaults          0       2

ToPro
Posts: 1
Joined: Wed Mar 07, 2018 2:39 pm

Re: Running Raspbian on USB Devices : Made Easy

Wed Mar 07, 2018 2:44 pm

RonR wrote:
Mon Feb 19, 2018 11:45 pm
usb-boot now mounts the BOOT partition of the SD card
Does this mean that we now need SD card?

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Wed Mar 07, 2018 8:47 pm

ToPro wrote:
Wed Mar 07, 2018 2:44 pm
RonR wrote:
Mon Feb 19, 2018 11:45 pm
usb-boot now mounts the BOOT partition of the SD card
Does this mean that we now need SD card?
The premise put forth in the first post of this topic is that the easiest and most reliable way to run Raspbian from a USB device is to leave an SD card in place to perform the initial steps of the booting process. To that end, the purpose of the usb-boot script is to facilitate that approach.

If you are able to boot a USB device directly without an SD card attached and are not concerned with the limitations of that approach, then the boot partition of the USB device should be mounted on /boot.

User avatar
XP1
Posts: 3
Joined: Sat Jun 02, 2012 3:04 pm

Re: Running Raspbian on USB Devices : Made Easy

Tue Apr 03, 2018 9:01 am

Instead of replicating a live installation from the SD card, is it possible to adapt the script to read from the original IMG file?

This accomplishes two goals:
  1. It is simpler to start off with the common use case of a clean install. Why go through the trouble of writing the IMG to the SD card, booting the OS, copying the script, and then running the script on Raspian? Just skip all those steps and write the original IMG to USB directly.
  2. Writing the IMG to the SD card is too much data for small SD cards. If the SD card is only used for booting, why do we need the entire Raspian OS on the SD card? I need to use those small 1GB SD cards, which are useless for anything else.

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Running Raspbian on USB Devices : Made Easy

Tue Apr 03, 2018 9:18 am

XP1 wrote:
Tue Apr 03, 2018 9:01 am
Instead of replicating a live installation from the SD card, is it possible to adapt the script to read from the original IMG file?
There should be no need to use this "script" anymore. Simply copy the image file to your USB device with dd or etcher, and on a 3P+ just plug it in (without and SD card) and it should boot.
On a 3B you will need to set the One Time Programmable (OTP) boot enable bit. (see here https://www.raspberrypi.org/documentati ... des/msd.md ).
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
XP1
Posts: 3
Joined: Sat Jun 02, 2012 3:04 pm

Re: Running Raspbian on USB Devices : Made Easy

Tue Apr 03, 2018 12:17 pm

PeterO wrote:
Tue Apr 03, 2018 9:18 am
There should be no need to use this "script" anymore.
Thanks, I just found out about the modern way of booting by reading the "Special bootcode.bin-only boot mode" section:
https://www.raspberrypi.org/documentati ... /README.md
Just format an SD card as FAT32 and copy on the latest bootcode.bin.
I have a Pi 1, and the instructions are so simple. After formatting the SD card, I just download the "bootcode.bin" file and saved it to the SD card.

Don't need the script. :)

RonR
Posts: 3194
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian on USB Devices : Made Easy

Tue Apr 03, 2018 7:57 pm

XP1 wrote:
Tue Apr 03, 2018 12:17 pm
I have a Pi 1, and the instructions are so simple. After formatting the SD card, I just download the "bootcode.bin" file and saved it to the SD card.

Don't need the script. :)

If you don't mind the limitations, that may be true.
RonR wrote:
Fri Nov 03, 2017 8:11 am
A Raspberry Pi 3 has a USB boot mode that has to be permanently enabled by setting an OTP bit. A bootcode.bin file is available for all Raspberry Pi models. Unfortunately, both of these approaches have serious limitations and once working, can easily be broken by simply plugging in an additional USB storage device.

Return to “Advanced users”