What I want to do is something really simple just like in an ordinary computer you can set the boot order, I'd like to do this on a raspberry pi, if there is a bootable usb media use that, if not fall back to sd card. All over the web I read about some complicated settings and OTP whatever that is, is it really that hard to do something so simple?
-
1Yes. The Pi equivalent of the PC "bios" is on the card.– Tomas ByDec 13, 2018 at 12:08
-
Might be possible with U-Boot.– Arkadiusz DrabczykDec 13, 2018 at 12:19
-
The RPi 3B & 3B+ have a feature that means some One-Time-Programmable bits can be set (when a bit is set you can never ever reset it back again) that will make it boot in a different order see here for an explanation.– SlySvenDec 14, 2018 at 3:27
2 Answers
A Raspberry Pi has a proprietary built-in boot manager and there is no way to modify it. It has a fixed boot order and will always boot from the SD Card if it is plugged in. It also depends on the model you are using. It is known that the RasPis have problems booting from other devices than the SD Card. This was one of the main reasons for the release of the RPi 3B+. It has fixed and improved boot options. Look at Raspberry Pi boot modes how booting is managed on Raspberry Pi. You may try to install a boot manager on the SD Card like U-Boot or BerryBoot.
Turned out I can do what I needed without booting into the USB at all, using chroot
. Just posting this in case I can save someone the trouble I went through being the linux noob that I am.
An ordinary raspbian installation will have only 2 partitions - boot and rootfs. In order to run commands on a raspbian installation on a USB stick while running the pi off of the SD card slot you need to mount /dev/sd?2
at say /mnt
and then mount /dev/sd?1
at /mnt/boot
. Then you can use chroot /mnt
-
1This is one of those cases where asking how to do what you needed may have gotten an easier answer. If you ask how to do X because you think you need that to do Y, it's usually better to ask how to do Y first. I just made the same mistake today. Anyway glad you got it working.– T. M.Dec 16, 2018 at 23:53
-