Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2017 08:35:53 +0200 (CEST)
From:      =?ISO-8859-1?Q?Trond_Endrest=F8l?= <Trond.Endrestol@fagskolen.gjovik.no>
To:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: UEFI booting question
Message-ID:  <alpine.BSF.2.21.1707250756460.53090@mail.fig.ol.no>
In-Reply-To: <CAD1v3Y5dGPaAv-1HZZVposXMX7Xox_b0658M3DATZ6WXBuRFjw@mail.gmail.com>
References:  <alpine.BSF.2.00.1707200106500.33403@bucksport.safeport.com> <CAD1v3Y5dGPaAv-1HZZVposXMX7Xox_b0658M3DATZ6WXBuRFjw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 20 Jul 2017 09:49-0700, Ashley Chase wrote:

> iOn Thu, Jul 20, 2017 at 8:35 AM, DTD <doug@safeport.com> wrote:
> > I have installed FreeBSD 10.3 into a partition but am unable to figure out
> > how to get rEFInd boot the partition. The gpart list shows the following (I
> > have filled in info from Windows dispart also):
> >
> >    ada0     GPT (932G)
> >             -free-         1.0M
> >    ada0p1   EFI            1.0M   K
> >    ada0p2   ms-reserved    16M
> >    ada0p3   ms-basic-data  446G   C   Windows
> >    ada0p8   EFI            1.0G
> >    ada0p9   freebsd-swap   4.0G
> >    ada0p10  freebsd-ufs    438G
> >             -free-         241M
> >    ada0p4   ms-basic-data  25G    D   LENOVO
> >    ada0p5   !de94bba...    1.0G       WINRE_DRV
> >    ada0p6   !de94bba...    15G        LENOVO_PART
> >    ada0p7   !bfbfafe7...   1.0G
> >             -free-         712K

> It seems odd to me that you have 2 EFI partitions. Where did the
> second ada0p8 come from?

One of them was created by the Windows installer and the other by the 
FreeBSD installer. It's not a problem having additional EFI System 
Partitions (ESP), the UEFI spec allows it (subsection 13.3.3), but it 
might cause some confusion.

Why is the second ESP at 1 GiB? Then again the other one is only at 1 
MiB. Maybe the smallest ESP was created by the FreeBSD installer.

Whenever dealing with a multi OS setup, first do your research to 
discover which OS creates which partitions. Install the least 
cooperating OS first. Make extra copies of the EFI boot loaders for 
each OS along the way. That's sure handy if you later want to use 
rEFInd or some other boot manager like GRUB2.

I too noticed FreeBSD is in the habit of creating its own ESP, even if 
one already exists. I felt only one is needed, and I decided to take 
matters into my own hands when I installed FreeBSD on my laptop, a 
Dell Latitude E5530 already running Windows 10. I was installing 
FreeBSD on ZFS, so that's a semi-manual install due to my own 
preferences on the ZFS FS layout.

Depending on the maturity of the UEFI firmware, you can specify your 
own boot entries in the firmware setup, including one for rEFInd. That 
way you have multiple options in the future.

In the worst case when UEFI isn't mature enough to remember your boot 
options, you must create boot/efi/nstartup.nsh, a text file containing 
the absolute pathname of your preferred UEFI boot loader, e.g. rEFInd.
The FreeBSD installer might have created a nstartup.nsh file for you.

Consider this to be a great opportunity to learn more about UEFI and 
GPT.

I recommend reading Chapter 5 and Section 13.3 in the current UEFI 
spec, now at version 2.7. You may skim the rest of the spec.

http://www.uefi.org/
http://www.uefi.org/specifications
http://www.uefi.org/sites/default/files/resources/UEFI_Spec_2_7.pdf

> > I do not know what to do from here. gpart set -a actvie ada0 breaks all
> > except from booting from the CD. geom=ada0 is the only accepted target for
> > set.
> 
> Check out uefi(8) man page.
> 
> Assuming you have refind installed, you should be able to copy
> /boot/loader1.efi to your ESP after mounting it. (The EFI System
> Partition is just an FAT32 filesystem. Refind should find the efi
> executable automatically.
> 
> If you don't have refind installed. look at the instructions for
> manually installing on linux. You'll have to rename refind_x64.efi to
> bootx64.efi because FreeBSD doesn't have efibootmgr.
> 
> You may need to grow the ESP to fit refind or trim down the refind files.
> 
> Also, if you go resizing Windows partitions MAKE SURE to fully
> shutdown Windows or disable "rapid startup" or whatever it's called if
> you're running Windows 8 or newer.
> 
> > Killing windows is not a deal breaker for me (I tried to get the laptop w/o
> > an O/S). I can not tell if doing a full disk install will revert all to a
> > legacy BIOS setup.
> 
> If you boot with UEFI when installing, you should have the choice to
> install using GPT or MBR partitioning and BIOS or UEFI bootloader.
> 
> On Thu, Jul 20, 2017 at 8:35 AM, DTD <doug@safeport.com> wrote:
> > I have installed FreeBSD 10.3 into a partition but am unable to figure out
> > how to get rEFInd boot the partition. The gpart list shows the following (I
> > have filled in info from Windows dispart also):
> >
> >    ada0     GPT (932G)
> >             -free-         1.0M
> >    ada0p1   EFI            1.0M   K
> >    ada0p2   ms-reserved    16M
> >    ada0p3   ms-basic-data  446G   C   Windows
> >    ada0p8   EFI            1.0G
> >    ada0p9   freebsd-swap   4.0G
> >    ada0p10  freebsd-ufs    438G
> >             -free-         241M
> >    ada0p4   ms-basic-data  25G    D   LENOVO
> >    ada0p5   !de94bba...    1.0G       WINRE_DRV
> >    ada0p6   !de94bba...    15G        LENOVO_PART
> >    ada0p7   !bfbfafe7...   1.0G
> >             -free-         712K
> >
> > I do not know what to do from here. gpart set -a actvie ada0 breaks all
> > except from booting from the CD. geom=ada0 is the only accepted target for
> > set.
> >
> > Killing windows is not a deal breaker for me (I tried to get the laptop w/o
> > an O/S). I can not tell if doing a full disk install will revert all to a
> > legacy BIOS setup.
> >
> > _____
> > Douglas Denault
> > http://www.safeport.com
> > doug@safeport.com
> > Voice: 301-217-9220
> >   Fax: 301-217-9277

-- 
Trond



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.21.1707250756460.53090>