Booting the raspberry pi 2 from a usb hd

Ronald Klop ronald-lists at klop.ws
Mon Oct 1 18:42:05 UTC 2018


On Mon, 01 Oct 2018 12:56:58 +0200, Victor <vdemart at gmail.com> wrote:

> I'm using a pi 2 card with FreeBSD 11.2-STABLE on the required sd card.  
> It works like a charm but using it as a postgresql server with many  
> write operation on it, to be on the safe side, I would like to move the  
> operating system to an external hard-disk or ssd.
> I've been surfing the net to find if it is possible to boot my pi 2 from  
> an external hard-disk (or SSD) to no avail.
> Could you please give me some hint, directions on this subject?
> Ciao
> Vittorio

Booting a raspberry pi starts with u-boot. It is loaded from a msdos  
partition on the SD-card.
U-boot loads the FreeBSD boot loader, which knows how to load the kernel.  
A modern u-boot can load the FreeBSD boot loader from USB.

An alternative is to have the FreeBSD /boot dir on the SD and load all the  
rest from the SSD.

This is the relevant part of my fstab:
/dev/gpt/ssdrootfs	/       ufs     rw,noatime      1       1
/dev/ufs/rootfs		/bootdir       ufs     rw,noatime      1       1
/dev/msdosfs/MSDOSBOOT	/boot/msdos msdosfs rw,noatime 0 0

And a symlink to keep it together:
$ ls -l /boot
lrwxr-xr-x  1 root  wheel  12 Jul 15 17:38 /boot@ -> bootdir/boot

A little bit more information:
https://wiki.freebsd.org/FreeBSD/arm/Raspberry%20Pi
https://wiki.freebsd.org/FreeBSD/arm/U-Boot-ports
https://wiki.freebsd.org/RootOnZFS/UFSBoot

Regards,
Ronald.


More information about the freebsd-arm mailing list