fabycyberbob
Posts: 40
Joined: Mon Nov 07, 2016 3:58 pm

usb_boot_mode=1 disable the boot via SD or both method will stay active?

Fri May 18, 2018 7:27 am

Hi All,
on a raspberry Pi B3, if I change boot method with:

"echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt"

The Raspi will boot directly from the USB pen, without the necessity to have also the microSd inserted.
BUT this procedure DISABLE THE BOOT via SD ?? OR BOTH Method will be stay active??

if I will require to boot yet from the SD CARD, is enought to don't insert the USB PEN or I have to change something with terminal command?
Thanks in advance

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Fri May 18, 2018 7:49 am

Once you've set the USB boot option it is set forever (on that Raspberry).

It doesn't stop you booting from a SDCard if no bootable USB device is connected.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

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

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Fri May 18, 2018 6:01 pm

It is enough to insert a bootable SD card into the SD card slot of your Raspberry Pi. Even if there is a bootable USB device connected at the same time.

LTolledo
Posts: 736
Joined: Sat Mar 17, 2018 7:29 am

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Sat May 19, 2018 1:15 am

mSD boot is default even after setting the OTP

bootalbe mSD + bootable USB device --> Pi boots from mSD

non-bootable mSD + bootalbe USB device --> Pi boots from USB device
Last edited by LTolledo on Sat May 19, 2018 8:07 pm, edited 1 time in total.
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

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

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Sat May 19, 2018 9:25 am

DougieLawson wrote:
Fri May 18, 2018 7:49 am
Once you've set the USB boot option it is set forever (on that Raspberry).

It doesn't stop you booting from a SDCard if no bootable USB device is connected.
Actually, SD card boot has priority. LTolledo is correct in the post above. Pi checks for SD card first, and then if none is found (or a non-bootable SD card is in the system), then it checks for boot USB drives.
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?

epoch1970
Posts: 2126
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Sat May 19, 2018 9:49 am

Yes the boot order is described in RPFs docs in github, the SD is always scanned first.
The boot process scans volumes for a VFAT partition with boot.bin and other binaries in it.
I’ve read somewhere that the bootable partition doesn’t need to be in 1st position in the table anymore, I couldn’t confirm that.
The scan operates volume by volume. If you have 2 VFAT partitions on a volume, first one fake and 2nd one real, the 1st one gets tested and although it doesn’t allow booting the 2nd one is not tested. Instead the next volume is scanned.

To stop booting from the SD when the SD is inserted, I’ve confirmed a “suicide” option is possible, where the running OS alters /boot so that it won’t be selected on next reboot.
I don’t remember details, I think I renamed boot.bin to boot.hidden and that was that.
I remember trying to change the FS type label for the boot partition (from fat16 to “hidden Fat16” or something like that) but that did not produce the expected effect, the partition is still tested and used if possible.
Deleting the partition is a possibility but that’s a bit radical and IIRC a rename was enough.

Obviously when you do that there is no going back, and if the system fails to reboot via USB or network, your Pi is dead in the water.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

as1mov48
Posts: 5
Joined: Tue Jun 12, 2018 10:16 pm

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Wed Jun 13, 2018 7:02 am

Sorry for the interruption, but could you please help me.
I'm trying to enable boot from USB, I've got as far in the terminal window as, echo program_usb_boot_mode=1, then there's a character, a vertical line, then it continues, sudo tee -a /boot/config.txt but I can't for the life of me get the character (vertical line). I've tried asci 124 but that's a nono.
Could you please help, I'm an old fart just new to Linux, and waiting for the reference books to arrive.
Thanks in anticipation

as1mov

B.Goode
Posts: 6544
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Wed Jun 13, 2018 7:32 am

I can't for the life of me get the character (vertical line).

In Linux-Speak that's a 'pipe' character, because it is used to indicate that you want to pipe the output from the echo command to the input of the tee command.



For 2 suggestions, see this subsequent standalone thread: viewtopic.php?f=91&t=215882

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

Re: usb_boot_mode=1 disable the boot via SD or both method will stay active?

Thu Jun 14, 2018 7:34 pm

Maybe it helps to know, what the statement is supposed to do, that you can't type.

It simply appends a line

Code: Select all

program_usb_boot_mode=1
to the file /boot/config.txt. Additionally the same line is printed on the terminal. But this is optional. You could do the same with an editor. /boot/config.txt is config.txt on the "boot" partition. Don't "repair" the card if you plug it into a Windows PC to edit the file.

Return to “Advanced users”