# Raspberry Pi B FreeBSD 11.2 does not boot with USB pendrive inserted



## Bazzz (Nov 14, 2018)

I am trying to install FreeBSD on a Raspberry Pi B (not 2 or 3, the old one).
I prepared an SD card with the FreeBSD 11.2 image from download.freebsd.org/ftp/snapshots/arm/armv6/ISO-IMAGES/ and booted the Pi with it. This seems to work fine. Then I added a USB pendrive, and used gpart to make a GPT freebsd-ufs partition on the whole drive. Now when I reboot the Pi with the pendrive inserted it does not boot any more. When I remove the pendrive it boots fine again. Below are some photos of the information on screen. (Sorry for fussy photos, I do not know how to take screenshots on FreeBSD when it does not boot.)
It seems that U-Boot detects the USB pendrive and, somehow believes that it should boot from it.
I would like to change it to "always boot from the sd card", but I do not know how.
Any tips?


----------



## tingo (Nov 23, 2018)

Try a beefier power supply. Try a different usb stick.


----------



## Phishfry (Nov 24, 2018)

This is completely orthogonal but the image you are using is not what I would use.
You are referencing a STABLE snapshot but the download page has specific downloads for each platform. Tested releases.
For Pi-B this would be the download location:
https://download.freebsd.org/ftp/re...2/FreeBSD-11.2-RELEASE-arm-armv6-RPI-B.img.xz

Have you tried this image instead of a STABLE snapshot?


----------



## trev (Nov 26, 2018)

My RPi2 recently (a few mnths ago now) started attempting to boot from USB pendrives instead of the micro-SD card.

The SD card kept being assigned as disk2, with the USB memory keys taking up disk0 and disk1, and then the system would unsuccessfully try booting  from disk0 and finding no kernel file as that happened to be the /usr file system.

After much google-fu, the workaround I found was to halt the boot at the uboot loader prompt (you have two seconds) and then:

setenv loaderdev disk2
saveenv
boot

The above creates a persistent uboot.env file, so no manual intervention is needed again (unless the number of USB memory keys changes). You'll need to work out the appropriate disk number tweak.


----------



## Phishfry (Nov 26, 2018)

trev said:


> started attempting to boot from USB pendrives instead of the micro-SD card.


Wasn't there a rework of FreeBSD uboot recently? I thought I read that upstream uboot is ditching the API which we were using.
So in the end we make out better because we are using the same uboot as Linux without the API which they did not use.
2 less patches required now. We will see some improvements like USB booting.
This is why I recommended -RELEASE instead of -STABLE. There is some rework in the pipe.


----------



## trev (Dec 1, 2018)

The change to try booting from USB devices probably occurred around July/August this year judging by my post in the arm mailing list.

Since then I haven't really kept up with what's happening as Great Cow BASIC on FreeBSD and macOS became my next project. So many projects, so little time


----------



## epretorious (Feb 3, 2019)

Bazzz said:


> It seems that U-Boot detects the USB pendrive and, somehow believes that it should boot from it.
> I would like to change it to "always boot from the sd card", but I do not know how.
> Any tips?



This discussion of the RPi boot process is kind of old (i.e., 2012) but it might be useful. Here are the highlights, as they pertain to your particulars:



			
				https://www.raspberrypi.org/forums/viewtopic.php?t=6685 said:
			
		

> When the Raspberry Pi is first turned on, the ARM core is off, and the GPU core is on. At this point the SDRAM is disabled.
> The GPU starts executing the first stage bootloader, which is stored in ROM on the SoC. The first stage bootloader reads the SD card, and loads the second stage bootloader (bootcode.bin) into the L2 cache, and runs it.




The collection of Official Documentation ("Raspberry Pi boot modes") sheds more light on the subject:



			
				https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/ said:
			
		

> Boot Sequence
> SD card boot
> USB boot comprises the following two modes:
> 
> ...



HTH,


----------

