fabycyberbob
Posts: 19
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: 32342
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, 3B*3, 3B+

Please post ALL technical questions on the forum. Do not send private messages.

fbe
Posts: 204
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: 11
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.

User avatar
HawaiianPi
Posts: 2234
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: 1465
Joined: Thu May 05, 2016 9:33 am

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

Return to “Advanced users”

Who is online

Users browsing this forum: bbqbailey and 4 guests