DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th October 2017
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default FreeBSD 11.1 amd64 UEFI boot from ZFS mirror

The latest FreeBSD memstick.img can boot UEFI for the installation - the video display looks nice and all seems to work well. After installation, however, no more UEFI. Is there a way to boot UEFI from a ZFS mirror on an amd64 11.1 machine?
Reply With Quote
  #2   (View Single Post)  
Old 19th October 2017
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 461
Default

Disclaimer: I have zero experience with zfs and I haven't installed FreeBSD in a while.

However, I do know that to boot in UEFI mode you will need a FAT-formatted EFI system partition (type "0xEF" in the old MBR nomenclature) with FreeBSD's EFI loader placed at $ESP/EFI/BOOT/BOOTX64.EFI — any UEFI firmware should boot that loader automatically if it is found at that location.
__________________
Are you infected with Wetiko?
Reply With Quote
  #3   (View Single Post)  
Old 19th October 2017
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default

Holy crap, that sounds tedious. But, of course, many thanks for the pointer.

I wonder if the "EFI system partition (ESP)" could be a FAT formatted USB thumbdrive with some minimum set of files to get UEFI up then it redirects booting to continue from the otherwise independent ZFS-based system?

If there are any FreeBSD wizards or warriors out there who could help sort out this process, it seems like the recipe would be a nicety for other users. My system would certainly be in better shape. Without UEFI, the display is hideous; with it, the display looks pretty slick.

Last edited by hanzer; 20th October 2017 at 12:30 AM. Reason: smilulator
Reply With Quote
  #4   (View Single Post)  
Old 20th October 2017
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bitchy Nerd Elitist
 
Join Date: Dec 2015
Location: London
Posts: 461
Default

Quote:
Originally Posted by hanzer View Post
Holy crap, that sounds tedious.
I last installed FreeBSD over a year ago but UEFI was handled automagically, albeit without ZFS; did the installer attempt to create an EFI system partition itself?

Quote:
I wonder if the "EFI system partition (ESP)" could be a FAT formatted USB thumbdrive with some minimum set of files to get UEFI up then it redirects booting to continue from the otherwise independent ZFS-based system?
If the FreeBSD .efi loader is placed on an EFI system partition on a USB under /EFI/BOOT/BOOTX64.EFI (BOOTIA32.EFI for 32-bit systems) then your UEFI firmware should start it automatically — that is how the FreeBSD installer itself boots.

Whether the FreeBSD .efi loader will find your ZFS root on another drive is another question entirely and one that you are in a much better position to answer than I
__________________
Are you infected with Wetiko?

Last edited by Head_on_a_Stick; 20th October 2017 at 05:42 AM. Reason: typos
Reply With Quote
  #5   (View Single Post)  
Old 20th October 2017
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default

I've got to backup some data before experimenting, probably this weekend. Research suggests that it might be possible but I am still fuzzy on many of the details. For the record, and those who wish to follow, here are a few relevant data points:

https://wiki.freebsd.org/UEFI
https://lists.freebsd.org/pipermail/...st/048141.html
https://svnweb.freebsd.org/base?view...evision=294999
https://www.freebsd.org/news/status/...FI-Boot/Loader
Reply With Quote
  #6   (View Single Post)  
Old 20th October 2017
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Thumbs up Solved

This worked! The system is a typical root on a two-disk ZFS mirror (ada0, ada1) installed from FreeBSD-11.1-RELEASE-amd64-memstick.img. After that, a USB flash drive (da0) is configured to load UEFI like this:
Code:
gpart destroy -F da0
gpart create -s gpt da0
gpart add -s 800K -t efi da0
gpart add -t freebsd-ufs da0
gpart show da0
=>      40  31260592  da0  GPT  (15G)
        40      1600    1  efi  (800K)
      1640  31258992    2  freebsd-ufs  (15G)

newfs_msdos da0p1 
newfs -t da0p2
mount -t msdosfs /dev/da0p1 /mnt
mkdir -p /mnt/efi/boot
cp /boot/boot1.efi /mnt/efi/boot/BOOTx64.efi
mkdir -p /mnt/boot
cat > /mnt/boot/loader.rc << EOF
unload
set currdev=zfs:zroot/ROOT/default:
load boot/kernel/kernel
load boot/kernel/zfs.ko
autoboot
EOF
I was very surprised this worked but it seems to be getting the job done.

Edit: I forgot to mention that the machine's BIOS was configured to boot from the flash drive (da0) in UEFI mode for this to work.

Last edited by hanzer; 20th October 2017 at 11:00 PM.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot i386, install amd64 beiroot OpenBSD Installation and Upgrading 4 10th May 2017 12:10 AM
Can't boot after successful install of 5.9 amd64 on a macbook 4.1 fvgit OpenBSD Installation and Upgrading 12 5th February 2017 11:39 PM
openbsd don't boot of AMD64 philo_neo71 OpenBSD Installation and Upgrading 3 19th October 2015 09:42 AM
FreeBSD 7 EOL and UEFI shep News 0 8th March 2013 01:51 AM
Allow i386 and amd64 to boot from extended DOS partitions lvlamb OpenBSD General 4 16th July 2008 03:24 PM


All times are GMT. The time now is 04:20 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick