booting freebsd on raspberry pi from external USB drive

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  [deletethis] scottsonline.org.uk) 
Harlow Essex 
"The only way is Brexit" -- anon.
Reply to
Mike Scott
Loading thread data ...

...

...

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

formatting link

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  [deletethis] scottsonline.org.uk) 
Harlow Essex 
"The only way is Brexit" -- anon.
Reply to
Mike Scott

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
Reply to
Don Kuenz

WEIRD.

--
Gun Control: The law that ensures that only criminals have guns.
Reply to
The Natural Philosopher

...

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

--
Mike Scott (unet2  [deletethis] scottsonline.org.uk) 
Harlow Essex 
"The only way is Brexit" -- anon.
Reply to
Mike Scott

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  [deletethis] scottsonline.org.uk) 
Harlow Essex 
"The only way is Brexit" -- anon.
Reply to
Mike Scott

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"
Reply to
The Natural Philosopher

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 
The computer obeys and wins.                |    licences available see 
You lose and Bill collects.                 |    http://www.sohara.org/
Reply to
Ahem A Rivet's Shot

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? 
	Well, I treat mine like 'n AMUSEMENT PARK...  S'great...
Reply to
alister

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.)

--
/~\  cgibbs@kltpzyxm.invalid (Charlie Gibbs) 
\ /  I'm really at ac.dekanfrus if you read it the right way. 
 X   Top-posted messages will probably be ignored.  See RFC1855. 
/ \  HTML will DEFINITELY be ignored.  Join the ASCII ribbon campaign!
Reply to
Charlie Gibbs

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

Reply to
bob prohaska

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  [deletethis] scottsonline.org.uk) 
Harlow Essex 
"The only way is Brexit" -- anon.
Reply to
Mike Scott

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.

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

Reply to
bob prohaska

On Fri, 14 Jul 2017 23:12:21 +0000 (UTC), bob prohaska declaimed the following:

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

That will shorten the SD card life significantly!

--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/
Reply to
Dennis Lee Bieber

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

Reply to
bob prohaska

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
Reply to
druck

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

Reply to
bob prohaska

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.