balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Booting from USB on RPi3

Fri Aug 09, 2019 5:09 pm

I'm trying figure out if I can boot from USB on RPi 3 (Raspberry Pi 3 Model B V1.2 to be exact).

Reading some documentation here:

https://github.com/raspberrypi/document ... ootflow.md

it suggests that I can't. Can anyone confirm whether I can or can't?

How can I determine whether I have a BCM2837-based model? I suspect mine is a BCM2835...

Andyroo

Re: Booting from USB on RPi3

Fri Aug 09, 2019 5:23 pm

Have a look at https://www.raspberrypi.org/documentati ... des/msd.md

You have to set the USB one time program bit then you are set to go.

Note that not all USB adapters will let you boot from the USB drive, some need a basic SD boot card to kick the process off before the HDD (or SSD) takes over.

User avatar
davidcoton
Posts: 4200
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Booting from USB on RPi3

Fri Aug 09, 2019 5:25 pm

https://www.raspberrypi.org/documentation/hardware/raspberrypi/README.md wrote: BCM2835

The Broadcom processor used in Raspberry Pi 1 and Zero

BCM2836

The Broadcom processor used in Raspberry Pi 2

BCM2837

The Broadcom processor used in Raspberry Pi 3 (and later Raspberry Pi 2)

BCM2837B0

The Broadcom processor used in Raspberry Pi 3B+ and 3A+

BCM2711

The Broadcom processor used in Raspberry Pi 4B
So all Pi3 models use BCM2837. Some models require the USB boot mode to be enabled, see https://www.raspberrypi.org/documentati ... des/msd.md
Signature retired

W. H. Heydt
Posts: 11016
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Booting from USB on RPi3

Fri Aug 09, 2019 5:28 pm

balanga wrote:
Fri Aug 09, 2019 5:09 pm
I'm trying figure out if I can boot from USB on RPi 3 (Raspberry Pi 3 Model B V1.2 to be exact).

Reading some documentation here:

https://github.com/raspberrypi/document ... ootflow.md

it suggests that I can't. Can anyone confirm whether I can or can't?

How can I determine whether I have a BCM2837-based model? I suspect mine is a BCM2835...
All Pi3B and Pi3B+ boards use the BCM2837, as does the Pi3A+ and the CM3/CM3+ modules. The reason the SoC gets reported as a BCM2835 is because of the way Debian handles things.

The answer to your basic question is...Yes. You can boot a Pi3B from a USB stick. First you will have to set a "one time program" (OTP) bit to enable the feature (on the Pi3B+ the bit is set at the factory).

The procedures to set up boot over USB are here: https://www.raspberrypi.org/documentati ... des/msd.md

Note that there is an error in the second paragraph. There is no Pi3A.

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

Re: Booting from USB on RPi3

Fri Aug 09, 2019 6:10 pm

balanga wrote:
Fri Aug 09, 2019 5:09 pm
I'm trying figure out if I can boot from USB on RPi 3 (Raspberry Pi 3 Model B V1.2 to be exact).
Running Raspbian on USB Devices : Made Easy will give you some insight. The usb-boot script attached to that posting will allow you to easily run Raspbian on a USB device using any model Raspberry Pi (1/2/3/4). No additional tools are required.

W. H. Heydt
Posts: 11016
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Booting from USB on RPi3

Fri Aug 09, 2019 6:33 pm

RonR wrote:
Fri Aug 09, 2019 6:10 pm
balanga wrote:
Fri Aug 09, 2019 5:09 pm
I'm trying figure out if I can boot from USB on RPi 3 (Raspberry Pi 3 Model B V1.2 to be exact).
Running Raspbian on USB Devices : Made Easy will give you some insight. The usb-boot script attached to that posting will allow you to easily run Raspbian on a USB device using any model Raspberry Pi (1/2/3/4). No additional tools are required.
The Pi4B cannot YET run a pure boot over USB. Any Pi 1 series and the Pi2Bv1.1 can not do a pure boot from USB. As noted in the link I provided, the full boot from USB is only available for the Pi2Bv1.2, Pi3B, Pi3B+ and Pi3A+. It can also be done with aCM3 (and, if I ever get it working, CM3+), but most people never even touch those modules, let alone try to do anything significant with them.

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

Re: Booting from USB on RPi3

Fri Aug 09, 2019 6:53 pm

W. H. Heydt wrote:
Fri Aug 09, 2019 6:33 pm
RonR wrote:
Fri Aug 09, 2019 6:10 pm
balanga wrote:
Fri Aug 09, 2019 5:09 pm
I'm trying figure out if I can boot from USB on RPi 3 (Raspberry Pi 3 Model B V1.2 to be exact).
Running Raspbian on USB Devices : Made Easy will give you some insight. The usb-boot script attached to that posting will allow you to easily run Raspbian on a USB device using any model Raspberry Pi (1/2/3/4). No additional tools are required.
The Pi4B cannot YET run a pure boot over USB. Any Pi 1 series and the Pi2Bv1.1 can not do a pure boot from USB. As noted in the link I provided, the full boot from USB is only available for the Pi2Bv1.2, Pi3B, Pi3B+ and Pi3A+. It can also be done with aCM3 (and, if I ever get it working, CM3+), but most people never even touch those modules, let alone try to do anything significant with them.
If you had bothered to read Running Raspbian on USB Devices : Made Easy you would know that I was not referring to 'pure boot' capability, which is not needed on any Raspberry Pi in order to run Raspbian on a USB device.

W. H. Heydt
Posts: 11016
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Booting from USB on RPi3

Fri Aug 09, 2019 7:12 pm

RonR wrote:
Fri Aug 09, 2019 6:53 pm
W. H. Heydt wrote:
Fri Aug 09, 2019 6:33 pm
RonR wrote:
Fri Aug 09, 2019 6:10 pm


Running Raspbian on USB Devices : Made Easy will give you some insight. The usb-boot script attached to that posting will allow you to easily run Raspbian on a USB device using any model Raspberry Pi (1/2/3/4). No additional tools are required.
The Pi4B cannot YET run a pure boot over USB. Any Pi 1 series and the Pi2Bv1.1 can not do a pure boot from USB. As noted in the link I provided, the full boot from USB is only available for the Pi2Bv1.2, Pi3B, Pi3B+ and Pi3A+. It can also be done with aCM3 (and, if I ever get it working, CM3+), but most people never even touch those modules, let alone try to do anything significant with them.
If you had bothered to read Running Raspbian on USB Devices : Made Easy you would know that I was not referring to 'pure boot' capability, which is not needed on any Raspberry Pi in order to run Raspbian on a USB device.
It depends on how you define "boot over USB". Every time I've set that up since the actual "boot over USB" has been implemented, I go all the way and boot without an SD card at all. Anything else I would describe as a "partial boot from USB". Since the OP asked about booting a Pi3B from a USB device with no mention of a hybrid or partial boot, that's what I've been addressing. Anything you do with any form of Pi1, Pi2Bv1.1 or Pi4B (until the full boot over USB is added to the EEPROM) has to be a hybrid or partial USB boot.

Really, when you get right down to it, if you have to use an SD card, you are not actually booting from a USB device.

So, while your guide may be easy, it isn't the full job. The later is described in the documentation at the link I gave...and it's pretty easy to do.

DirkS
Posts: 9970
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Booting from USB on RPi3

Fri Aug 09, 2019 7:14 pm

RonR wrote:
Fri Aug 09, 2019 6:53 pm

If you had bothered to read Running Raspbian on USB Devices : Made Easy you would know that I was not referring to 'pure boot' capability, which is not needed on any Raspberry Pi in order to run Raspbian on a USB device.
IMO you should make clear that your method is *not* a pure USB boot as OP was looking for...
The way you write it suggests it *is* pure USB boot. Why would others have to follow links to get basic, relevant information?

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

Re: Booting from USB on RPi3

Fri Aug 09, 2019 7:41 pm

W. H. Heydt wrote:
Fri Aug 09, 2019 7:12 pm
Really, when you get right down to it, if you have to use an SD card, you are not actually booting from a USB device.

So, while your guide may be easy, it isn't the full job.
DirkS wrote:
Fri Aug 09, 2019 7:14 pm
IMO you should make clear that your method is *not* a pure USB boot as OP was looking for...
The way you write it suggests it *is* pure USB boot. Why would others have to follow links to get basic, relevant information?
The only difference between your 'pure boot' and using an SD card to run Raspbian from a USB device is whether you can permanently remove the SD card. When booting a USB device via an SD card, the SD card is only read (not written) and only for a brief instant. The end result is the same and numerous pitfalls are eliminated (pitfalls which will hopefully not be present in the Raspberry Pi 4 when its boot EEPROM is completed sometime in the not-so-near future). All this is spelled out in Running Raspbian on USB Devices : Made Easy. You're playing semantics games. Quit splitting hairs.

W. H. Heydt
Posts: 11016
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Booting from USB on RPi3

Fri Aug 09, 2019 7:46 pm

RonR wrote:
Fri Aug 09, 2019 7:41 pm
W. H. Heydt wrote:
Fri Aug 09, 2019 7:12 pm
Really, when you get right down to it, if you have to use an SD card, you are not actually booting from a USB device.

So, while your guide may be easy, it isn't the full job.
DirkS wrote:
Fri Aug 09, 2019 7:14 pm
IMO you should make clear that your method is *not* a pure USB boot as OP was looking for...
The way you write it suggests it *is* pure USB boot. Why would others have to follow links to get basic, relevant information?
The only difference between your 'pure boot' and using an SD card to run Raspbian from a USB device is whether you can permanently remove the SD card. When booting a USB device via an SD card, the SD card is only read (not written) and only for a brief instant. The end result is the same and numerous pitfalls are eliminated (pitfalls which will hopefully not be present in the Raspberry Pi 4 when its boot EEPROM is completed sometime in the not-so-near future). All this is spelled out in Running Raspbian on USB Devices : Made Easy. You're playing semantics games. Quit splitting hairs.
I can understand that you wish to push your own guide to doing things the way you like, but, as DirkS noted, that doesn't appear to be what the OP actually asked for. The data he needs is in the RPF documents and is easy to read and use.

balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Re: Booting from USB on RPi3

Fri Aug 09, 2019 8:19 pm

W. H. Heydt wrote:
Fri Aug 09, 2019 5:28 pm
balanga wrote:
Fri Aug 09, 2019 5:09 pm
I'm trying figure out if I can boot from USB on RPi 3 (Raspberry Pi 3 Model B V1.2 to be exact).
The answer to your basic question is...Yes. You can boot a Pi3B from a USB stick. First you will have to set a "one time program" (OTP) bit to enable the feature (on the Pi3B+ the bit is set at the factory).

The procedures to set up boot over USB are here: https://www.raspberrypi.org/documentati ... des/msd.md

Note that there is an error in the second paragraph. There is no Pi3A.
Never been so inundated with replies :)

I'm trying clarify what you said above...ie
First you will have to set a "one time program" (OTP) bit to enable the feature (on the Pi3B+ the bit is set at the factory).
if the bit is set at the factory, then surely I don't need to a 'one time program' - confused.

Is there any way to tell if this bit is already set.

Reading the procedures described, I understand that I just need to copy the SD card installation to a USB stick, but if I put the card into a USB adapter, doesn't that amount to the same thing?

trejan
Posts: 757
Joined: Tue Jul 02, 2019 2:28 pm

Re: Booting from USB on RPi3

Fri Aug 09, 2019 8:39 pm

balanga wrote:
Fri Aug 09, 2019 8:19 pm
if the bit is set at the factory, then surely I don't need to a 'one time program' - confused.
The USB boot bit is already set by default on a 3+. It isn't set for your 3.
balanga wrote:
Fri Aug 09, 2019 8:19 pm
Is there any way to tell if this bit is already set.
Read https://www.raspberrypi.org/documentati ... des/msd.md

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

Re: Booting from USB on RPi3

Fri Aug 09, 2019 8:49 pm

W. H. Heydt wrote:
Fri Aug 09, 2019 7:46 pm
I can understand that you wish to push your own guide to doing things the way you like, but, as DirkS noted, that doesn't appear to be what the OP actually asked for. The data he needs is in the RPF documents and is easy to read and use.
This is not a matter of a "wish to push your own guide to doing things the way you like". It's a matter of practicability and reliability.

Only the Raspberry Pi 3B, 3B+, 3A+, and 2B v1.2 have your 'pure boot' capability. Even on these models, booting directly to USB devices has significant compatibility issues due to the very limited code space that's available to implement it. As implemented, it's extremely fragile and you can boot to the wrong device or not boot at all if you plug in an additional USB mass storage device. Hopefully, one day the Raspberry Pi 4 will have a very intelligent and flexible USB booting capability. Until then, and for previous models, it's my opinion that using an SD card for booting USB devices is the only reliable method in the majority of environments.

I made usb-boot available so that users can reliably run Raspbian on USB devices without having to follow multiple pages of how-to manual instructions requiring additional knowledge of partitioning, formatting, creating file systems, running rsync, editing file system files, etc. It was recently enhanced to accommodate the Raspberry Pi 4. It also gives the option of 'pure boot' on Raspberry Pi's that have that capability if you elect to live with the compatibility and fragility issues associated with that option.

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

Re: Booting from USB on RPi3

Fri Aug 09, 2019 11:24 pm

balanga wrote:
Fri Aug 09, 2019 8:19 pm
I'm trying clarify what you said above...ie
First you will have to set a "one time program" (OTP) bit to enable the feature (on the Pi3B+ the bit is set at the factory).
if the bit is set at the factory, then surely I don't need to a 'one time program' - confused.

Is there any way to tell if this bit is already set.

Simply run:

Code: Select all

sudo vcgencmd otp_dump | grep 17:

If the following is displayed:

Code: Select all

17:3020000a

your Raspberry Pi can theoretically boot a USB mass storage device without an SD card installed. As explained elsewhere, however, there can be serious compatibility and reliability issues.

W. H. Heydt
Posts: 11016
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Booting from USB on RPi3

Sat Aug 10, 2019 12:04 am

RonR wrote:
Fri Aug 09, 2019 8:49 pm
Until then, and for previous models, it's my opinion that using an SD card for booting USB devices is the only reliable method in the majority of environments.
In my experience, the methods described in the official RPF documetation are consistently reliable and robust.

balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Re: Booting from USB on RPi3

Sat Aug 10, 2019 7:17 am

RonR wrote:
Fri Aug 09, 2019 11:24 pm
balanga wrote:
Fri Aug 09, 2019 8:19 pm

Is there any way to tell if this bit is already set.

Simply run:

Code: Select all

sudo vcgencmd otp_dump | grep 17:

If the following is displayed:

Code: Select all

17:3020000a

your Raspberry Pi can theoretically boot a USB mass storage device without an SD card installed. As explained elsewhere, however, there can be serious compatibility and reliability issues.

I have run the code to set the bit and now see:-

Code: Select all

17:3020000a
I power off the unit, take out the card and insert it in a USB adapter, plug in the USB adapter and power on again, and .... nothing...

I have I overlooked something?

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

Re: Booting from USB on RPi3

Sat Aug 10, 2019 7:34 am

balanga wrote:
Sat Aug 10, 2019 7:17 am
I power off the unit, take out the card and insert it in a USB adapter, plug in the USB adapter and power on again, and .... nothing...

I have I overlooked something?

With the SD card normally booted, ensure that:

Code: Select all

/boot/cmdline.txt:

... root=PARTUUID=12345678-02 ...

and

Code: Select all

/etc/fstab:

PARTUUID=12345678-01  /boot       vfat    defaults          0       2
PARTUUID=12345678-02  /           ext4    defaults,noatime  0       1

where 12345678 is the actual PARTUUID displayed by running:

Code: Select all

sudo blkid

Ernst
Posts: 1247
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Booting from USB on RPi3

Sat Aug 10, 2019 8:13 am

balanga wrote:
Sat Aug 10, 2019 7:17 am
I power off the unit, take out the card and insert it in a USB adapter, plug in the USB adapter and power on again, and .... nothing...

I have I overlooked something?
Yes. You should change the title of your post because your problem is that booting from an SD card in a USB card reader fails.

My experience is that this is as expected because a card reader is not the same as an USB storage device.
The road to insanity is paved with static ip addresses

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

Re: Booting from USB on RPi3

Sat Aug 10, 2019 8:21 am

Ernst wrote:
Sat Aug 10, 2019 8:13 am
Yes. You should change the title of your post because your problem is that booting from an SD card in a USB card reader fails.

My experience is that this is as expected because a card reader is not the same as an USB storage device.
Not true. I just double-checked and it boots here in a Raspberry Pi 3B+. An SD card in a USB adapter is exactly the same as any other USB storage device.

Ernst
Posts: 1247
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Booting from USB on RPi3

Sat Aug 10, 2019 8:25 am

RonR wrote:
Sat Aug 10, 2019 8:21 am
Ernst wrote:
Sat Aug 10, 2019 8:13 am
Yes. You should change the title of your post because your problem is that booting from an SD card in a USB card reader fails.

My experience is that this is as expected because a card reader is not the same as an USB storage device.
Not true. I just double-checked and it boots here in a Raspberry Pi 3B+. An SD card in a USB adapter is exactly the same as any other USB storage device.
True, it depends on the card reader which is not the same as an USB adapter.
The road to insanity is paved with static ip addresses

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

Re: Booting from USB on RPi3

Sat Aug 10, 2019 8:43 am

balanga wrote:
Sat Aug 10, 2019 7:17 am
I power off the unit, take out the card and insert it in a USB adapter, plug in the USB adapter and power on again, and .... nothing...

I have I overlooked something?
If you don't succeed in getting it to boot, try this with a fresh SD card and a USB flash drive:

1. Write Raspbian to the SD card and boot it up.

2. Insert the USB flash drive.

3. Run sudo usb-boot:

Use SD card to boot the USB device (recommended)? : Yes
Select the USB mass storage device to boot : {the USB flash drive}
Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sdX? : Yes
All existing data on USB device /dev/sdX will be destroyed!' / 'Do you wish to continue?' : Yes

4. When usb-boot finishes, reboot and you should be running from the USB flash drive.

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

Re: Booting from USB on RPi3

Sat Aug 10, 2019 9:07 am

balanga wrote:
Sat Aug 10, 2019 7:17 am
I power off the unit, take out the card and insert it in a USB adapter, plug in the USB adapter and power on again, and .... nothing...

I have I overlooked something?
What version of Raspbian, and has it been fully updated?

Boot from the SD card and post the output of the following commands.

Code: Select all

cat /etc/os-release
cat /boot/cmdline.txt
cat /etc/fstab
ls -l /dev/disk/by-partuuid
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?

balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Re: Booting from USB on RPi3

Sat Aug 10, 2019 10:27 am

Ernst wrote:
Sat Aug 10, 2019 8:13 am

My experience is that this is as expected because a card reader is not the same as an USB storage device.
So if I

Code: Select all

dd if=card of=usb-stick
should I be OK?

balanga
Posts: 118
Joined: Sat Aug 23, 2014 6:56 pm

Re: Booting from USB on RPi3

Sat Aug 10, 2019 10:32 am

HawaiianPi wrote:
Sat Aug 10, 2019 9:07 am
Boot from the SD card and post the output of the following commands.

Code: Select all

cat /etc/os-release
cat /boot/cmdline.txt
cat /etc/fstab
ls -l /dev/disk/by-partuuid
cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=92412d84-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

cat /etc/fstab
proc /proc proc defaults 0 0
PARTUUID=92412d84-01 /boot vfat defaults 0 2
PARTUUID=92412d84-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that


ls -l /dev/disk/by-partuuid
total 0
lrwxrwxrwx 1 root root 15 Aug 9 23:39 92412d84-01 -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Aug 9 23:39 92412d84-02 -> ../../mmcblk0p2

Return to “General discussion”