Installing FreeBSD 13 on an RPi with external drive


I am curious. I did a search of the forums, and didn't find anything. Is it possible to run FreeBSD 13 a raspberry pi model 3B+ completely from a USB external drive (as opposed to running on the microSD drive)? I have FreeBSD 13.2 running on the SD card on the pi, But I ran across a confluence of circumstances/desires in the last day or so:
  • Upgrading form 13.1 to 13.2 took nearly 8 hours on the SD card;
  • An external drive is a couple of orders of magnitude faster than a microSD;
  • I'd like to run ZFS on the pi, if possible (memory may be a constraint precluding this);
  • I found a 1TB (pre SMR) WD Passport drive sitting i a desk drawer collecting dust.
Is it possible to install and run FreeBSD 13 on a Pi from the hard drive?

Is it possible to install and run FreeBSD 13 on a Pi from the hard drive?
I tried all kinds of micro drives from 1.8" Half Slim SATA to 2.5" SSD via USB adapter.
Where I had troubles was USB to CFast adapter.
I wanted to use CFast with USB adapter but it did not show up right in u-boot.

So if you are new to this I would suggest flash FreeBSD to microSD and a USB stick.
Boot up off microSD and use u-boot to switch to usb drive.
Then boot off USB.
It will get your feet wet.

If you want the whole thing now:
Make a >20M boot partition type fat32lba on microSD and format
Stick the u-boot files on it. (Alternatively flash image to it and delete da0s2a)
Boot your microSD with uboot and go to u-boot command line.
Fiddle with usb device with FreeBSD on it (external drive or stick).
usb start
usb storage /* This should show your usb device/*
usb dev 0

The thing is you must use a microSD for u-boot on Pi3. The jump off to USB.
All the microsd card needs is files:
They land here: /usr/local/share/u-boot/u-boot-rpi3
There are different ways of doing it.
The way I show above puts only u-boot on microSD and EFI and UFS on USB are the stock FreeBSD RPI image.

You could also have microSD card with u-boot files on the EFI partition and use da0p2/da0s2a for USB drive.

I say this because you can use either GPT or MBR. So use your layouts naming.
You will probably want to edit /etc/fstab
It uses labels and when you use a microSD card with FreeBSD on it and USB drive with FreeBSD it can be confusing.
So I often disable labels and use actual device names in fstab.

usb dev 0
I want to note that this step sets usb dev 0 active. usb dev 0 being your usb device.
After you set this once it should boot from that drive without intervention. This is for the Raspberry Pi 4B

You are using the Raspberry Pi 3B+ might be the same setup to add an external USB 3.0 drive and use "bsdinstall" to install over the ethernet and internet to the external USB drive.

I welcome any comments you wish to leave. I can edit in differences you find with booting on the Raspi 3B+ into the blog. I welcome your testing and your feedback. I am enjoying the XFCE desktop on my Raspberry Pi 4B. Nice to have an external USB SSD drive for saving files.
I don't know about the pi 3b - only having USB2, would the usb/ssd boot be very much faster than an SD card?

That said, I set up a pi 400 with usb/ssd boot and zroot, following the suggestion here - 87492" href="/index.php?threads/87492/">Thread 87492.

(Sorry, I don't know why that THREAD markup is screwed up)

I installed 13.1-RELEASE to begin with, which I've since updated to 13.2-RELEASE. It's fine, running various bastille jails, and backing up using zsnap and zxfer to both local disks and another 13.2-RELEASE system.

My only issue at the moment is a bunch of lines in /var/log/messages when I do a backup (and only when I do a backup, so I'm thinking it's zfs send:

kernel: (da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 17 df ee 41 00 00 07 00

The READs succeed on the 2nd attempt 90% of the time, and on the 3rd attempt every other time, so I'm not too bothered for a home system. This is with a Kingston SA400S37/240GB SATA, which is frequently recommended for the Pi (by Linux users, though). So it's possible that SSD choice may be a concern with FreeBSD.
My experience with FreeBSD on a Raspberry Pi 4 is that it is really not playing well with USB storage.

This was well over a year ago, though. Hopefully the reliability has improved since, but I couldn't get the USB HDD setup to work at all.

I hope FreeBSD 14 handles this better, I really do not want to have to muck about with a GNU system just to get a working file server on a Pi.