Booting the raspberry pi 2 from a usb hd

Mark Millard marklmi at yahoo.com
Mon Oct 1 16:36:27 UTC 2018


On 2018-Oct-1, at 3:56 AM, 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?

The notes below are not rpi2 specific. I've done such on
many systems, including an rpi2.

One technique is that /etc/fstab on the microsd card media that has
the kernel can redirect to another device for where to mount / . (I
use one partition for all of world.)

I also tend to have /boot/loader.conf copies that contain something
like:

kern.cam.boot_delay=10000
vfs.mountroot.timeout=10

to help make sure things are ready for the external storage device
to be used.

Additional notes:

I tend to install a full world on the microsd card slot media with
the kernel so that I can boot that if needed, absent the external
drive. (This involves the boot prompting for where to boot from.)
I tend to keep the extra world's configuration tracking nearly
all of the external device's world configuration. That includes
/boot/loader.conf . But my configurations are rather simple,
with little changed from defaults.

But this also means that I might not notice if more than the
files /etc/fstab and /boot/loader.conf from the microsd card
media are put to use.

For /etc/fstab I tend to have comments that point to the
microsd card media for quick editing for switching the
world device: just switch which lines are commented vs. not.

I also tend to install the kernel on the external media, even
though it is not booted from. So I end up having 2 installs
overall.

I tend to use various forms of labels and paths that reference
labels instead of directly using device names, path prefixes:
/dev/ufs/ /dev/msdosfs/ /dev/gpt/ /dev/label/

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-arm mailing list