booting freebsd on raspberry pi from external USB drive

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I'm having problems getting freebsd to run off an external hard drive  
instead of the pi's SD card..


I've installed freebsd onto the pi3's SD card. The image used is  
FreeBSD-aarch64-12.0-GENERIC-320422M
which seems to work OK.

However, I really want the system to run from a USB hard drive. So I've  
copied over (dump -f- | restore -rf- ) the entire installation onto a  
spare partition (da0p2) on an external drive (that already contains a  
running raspbian: a similar procedure worked happily for that!).

I've edited the fstab on both the SD card and the HD to reflect the new  
root system. (Not sure which of the two kernels will be used, but that  
doesn't matter so much).

The system starts to boot, but the loader gives expected messages about  
umass0 followed by da0, then stops with

"mounting from /dev/da0p2 failed with error 19"

(device does not support operation??) and waits for a manual entry of  
the root device.


I simply enter
ufs:/dev/da0p2
and the boot finishes successfully.


I'm totally unclear about the boot process on i386, and all the more so  
with u-boot.

Is there something else I should be doing to set the boot device to  
something other than the SD card? Manual input isn't so good in the long  
term :-{

TIA.


--  
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
We've slightly trimmed the long signature. Click to see the full one.
resolved: Re: booting freebsd on raspberry pi from external USB drive
On 12/07/17 14:21, Mike Scott wrote:
Quoted text here. Click to load it
...
...


OK, I'll answer my own query. I finally hit on the right set of  
buzz-words for the search engine, and found the answer at  
https://forums.freebsd.org/threads/30254/


The usb disk is slow enough to need extra boot delay before / is  
mounted. So I've put into loader.conf
kern.cam.boot_delay="10000"

and all is well.

(Footnote: the loader.conf files /must/ be root-owned, or they are  
silently ignored during boot. Took ages to find that somehow loader.conf  
was owned by my non-root persona. Wierd. But all's well now.)



--  
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
We've slightly trimmed the long signature. Click to see the full one.
Re: resolved: Re: booting freebsd on raspberry pi from external USB drive

Quoted text here. Click to load it

This thread piqued my interest enough to search for an answer. As you
imply, it takes too much sleuthing to discern the proper keywords to
obtain meaningful results.

Beings you've already done the heavy lifting, is it possible for you to
share the /etc/fstab syntax to auto mount a usb file system? TIA.

Thank you,

--
Don Kuenz, KB7RPU

Re: resolved: Re: booting freebsd on raspberry pi from external USB drive
On 12/07/17 23:38, Don Kuenz wrote:
Quoted text here. Click to load it

Nothing special; from the PI:

/dev/da0p2    /        ufs rw,noatime        1 1

But I think the noatime can go - I believe it's to save additional wear  
on an SD card.

--  
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
We've slightly trimmed the long signature. Click to see the full one.
Re: resolved: Re: booting freebsd on raspberry pi from external USB drive
On Thu, 13 Jul 2017 08:43:02 +0100

Quoted text here. Click to load it

    Yes, but performance will be better with it too, unless the drive
is an SSD.

--  
Steve O'Hara-Smith                          |   Directable Mirror Arrays
C:>WIN                                      | A better way to focus the sun
We've slightly trimmed the long signature. Click to see the full one.
Re: resolved: Re: booting freebsd on raspberry pi from external USB drive
On 12/07/17 21:30, Mike Scott wrote:
Quoted text here. Click to load it
WEIRD.



--  
Gun Control: The law that ensures that only criminals have guns.

Re: resolved: Re: booting freebsd on raspberry pi from external USB drive
On 13/07/17 07:59, The Natural Philosopher wrote:
Quoted text here. Click to load it
...

Thank you. I have a habit of getting that one wrong. Most wierd :-}


--  
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
We've slightly trimmed the long signature. Click to see the full one.
Re: resolved: Re: booting freebsd on raspberry pi from external USB drive
On 13/07/17 08:38, Mike Scott wrote:
Quoted text here. Click to load it
It breaks not only the 'i before e', but also the 'except if it sounds  
like the sea'

So does rein.
and reign.

and a few other excamples.

--  
"It is an established fact to 97% confidence limits that left wing  
conspirators see right wing conspiracies everywhere"

Re: resolved: Re: booting freebsd on raspberry pi from external USB drive
On Thu, 13 Jul 2017 09:16:40 +0100, The Natural Philosopher wrote:

Quoted text here. Click to load it

if you were to perform a thorough check of the dictionary you would find  
that there are actually more words that break the rule than follow it
this is one of the reasons why it is no longer taught is schools.



--  
QOTD:
    Y'know how s'm people treat th'r body like a TEMPLE?
We've slightly trimmed the long signature. Click to see the full one.
Re: resolved: Re: booting freebsd on raspberry pi from external USB drive

Quoted text here. Click to load it

I before E except after C,
or when it says "A" as in "neighbour" and "weigh".

(Plus a few weird exceptions which may seize your attention.)

--  
/~\   snipped-for-privacy@kltpzyxm.invalid (Charlie Gibbs)
\ /  I'm really at ac.dekanfrus if you read it the right way.
We've slightly trimmed the long signature. Click to see the full one.
Re: booting freebsd on raspberry pi from external USB drive
Quoted text here. Click to load it

If I'm not mistaken, that gives you the kernel from the microSD card
but userland from the USB storage device. That may not be a bad thing
depending on what you're doing. If the machine is intended to build its
own world and kernel I think it'll make mischief.  

I'd be pleased to learn this is untrue.

I elected to use the microSD for / but put /usr /var swap and /tmp on usb
partitions on the notion that / is seldom written to.

bob prohaska


Re: booting freebsd on raspberry pi from external USB drive
On 14/07/17 03:01, bob prohaska wrote:
Quoted text here. Click to load it

Thanks for the comment.

TBH I don't know. I've always found the info for loader confusing; and  
with ubldr it's not exactly got clearer. Possibly just me - but I'm  
trying to use the OS, not learn about how it ticks.

My understanding, which is more than likely flawed, is that loader reads  
the fstab file, and mounts / accordingly, and I think the kernel is then  
loaded from /boot/.... which would mean (in this case) off the external  
drive.

But in my case, they're identical anyway, and it makes not one jot of  
difference in practice for my application.

But it would be good to know for sure!

(I'm not entirely convinced that running 'make buildworld' or whatever  
on the rpi would be a Good Idea in any event. :-}  )


As I've noted elsewhere, the problem I had was due to a race condition  
for recognising the USB drive and mounting / off it. Suggests to me  
something not quite kosher in the design of the boot procedure.


--  
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex
We've slightly trimmed the long signature. Click to see the full one.
Re: booting freebsd on raspberry pi from external USB drive
Quoted text here. Click to load it
This depends on one's definition of "good" 8-) For a minimal power and  
hardware setup it works fairly well. A complete build/install cycle can
be finished in a day.  

Quoted text here. Click to load it
Hopefully somebody will chime in with an accurate answer. I wanted to
do the very same thing a couple of years ago and reluctantly concluded
it was impossible. It would be good to learn that something has changed,  
but I've come across nothing to suggest it.  

In point of fact, I've spent the last two years trying to wear out
a microSD card and USB flash filesystem and there's no hint (sound of  
knuckles rapping forehead) of a problem. If you hook up a serial console
and play around with the u-boot prompts you'll find a "boot usb" command.

By no longer care, but maybe you do. The name certainly holds promise.

bob prohaska


Re: booting freebsd on raspberry pi from external USB drive
declaimed the following:


Quoted text here. Click to load it

Run multiple variations of the HINT benchmark setting up a swap file on the
SD card... <G>

That will shorten the SD card life significantly!
--  
    Wulfraed                 Dennis Lee Bieber         AF6VN
     snipped-for-privacy@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Re: booting freebsd on raspberry pi from external USB drive
Quoted text here. Click to load it

I don't doubt that flash can be worn out. I simply wanted to see if it's
a problem in my application. Seemingly not yet.

How it fails may be more significant.

bob prohaska


Re: booting freebsd on raspberry pi from external USB drive
On 15/07/2017 00:12, bob prohaska wrote:
Quoted text here. Click to load it

We use Pi's to drive serial and USB smartcard multiplexers, it runs a  
tiny python server sitting on top of a standard Raspbian wheezy, no  
additional writes over and above what the OS does by default. The cards  
are now starting to fail after 4 years of 24/7 uptime.

---druck

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


Re: booting freebsd on raspberry pi from external USB drive
Quoted text here. Click to load it

What failure modes are you observing? Presumably I have another year or
so to get ready 8-) It would be good if I could recognize the symptoms.

bob prohaska


Site Timeline