# Dual boot to Windows10 and FreeBSD in UEFI



## osenberg (Mar 8, 2021)

# install and others reference to install freebsd by zfs, and when we create boot that we follow my method as follows.

mount -t msdosfs /dev/ada0p1 /media   #  /dev/ada0p1  Windows10's EFI  whose size is better 512M 

cd /tmp
fetch https://nchc.dl.sourceforge.net/project/refind/0.13.1/refind-bin-0.13.1.zip
unzip refind-bin-0.13.1.zip

cd /media/EFI/Boot
mv bootx64.efi bootx64-windows10.efi
cp /boot/loader.efi bootx64-freebsd.efi
cp -a /tmp/refind-bin-0.13.1/refind/icons .
cp -a /tmp/refind-bin-0.13.1/refind/refind_x64.efi bootx64.efi
cp /tmp/refind-bin-0.13.1/refind/refind.conf-sample refind.conf

# vim refind.conf, append:
menuentry "FreeBSD/amd64 -CURRENT" {
    loader \EFI\Boot\bootx64-freebsd.efi
    icon \EFI\Boot\icons\os_freebsd.png
}

menuentry "Windows 10 Professional x64" {
    loader \EFI\Boot\bootx64-windows10.efi
    icon \EFI\Boot\icons\os_win.png
}

# create reFind boot
efibootmgr --create --activate --label "FreeBSD" --loader "/media/EFI/Boot/bootx64.efi"
umount /media
exit


----------



## ShelLuser (Mar 8, 2021)

Why would anyone want to boot their system with a completely unknown and vague EFI bootmanager which hasn't even left the beta stage? For all I know that thing could do tons of nasty stuff to my setup.

Not to mention that FreeBSD also supports EFI as well as the option to boot other operating systems. ... and the same can be said about the Windows boot manager (see for example programs like 'msconfig').

(edit)

Here, UEFI secure boot: https://freebsdfoundation.org/freebsd-uefi-secure-boot/


----------



## Snurg (Mar 8, 2021)

ShelLuser said:


> Why would anyone want to boot their system with a completely unknown and vague EFI bootmanager?


I would not consider rEFInd (~700 downloads/day) a "completely unknown and vague EFI bootmanager".
LOL, you made my day


----------



## osenberg (Mar 8, 2021)

ShelLuser said:


> Why would anyone want to boot their system with a completely unknown and vague EFI bootmanager which hasn't even left the beta stage? For all I know that thing could do tons of nasty stuff to my setup.
> 
> Not to mention that FreeBSD also supports EFI as well as the option to boot other operating systems. ... and the same can be said about the Windows boot manager (see for example programs like 'msconfig').
> 
> ...


It's little hard to me. I'm a new studant for FreeBSD. I have made it this far with a lot of effort.


----------



## Deleted member 66267 (Mar 8, 2021)

osenberg said:


> It's little hard to me. I'm a new studant for FreeBSD. I have made it this far with a lot of effort.


You tried it harder than me. I ended up bought another SSD to install FreeBSD, my current SSD is preserved for Linux and I press F11 each boot to choose the OS I want to boot into


----------



## osenberg (Mar 9, 2021)

also-ran said:


> You tried it harder than me. I ended up bought another SSD to install FreeBSD, my current SSD is preserved for Linux and I press F11 each boot to choose the OS I want to boot into


You can try this method, just instead Windows10 with Linux in refind.conf, it should be OK.


----------



## mickey (Mar 9, 2021)

There's no need to manually create menuentry sections in refind.conf as rEFInd will automatically scan for and detect bootloaders, and in most cases it will even automatically pick an appropriate icon for each one. You can control what drives are scanned for bootloaders by setting up _scanfor_ in refind.conf. Similarly if you want to exclude certain paths from being scanned, you can set up _dont_scan_dirs_. Just create a directory EFI/FreeBSD and copy /boot/loader.efi to it, and rEFInd will find it automatically. No need to mess with the files in EFI/Boot. If you installed Windows 10, the file EFI/Boot/Bootx64.efi is just a copy of EFI/Microsoft/Boot/bootmgfw.efi, and there's a distinct possibility that Windows updates could eventually replace this file. Instead of replacing EFI/Boot/Bootx64.efi with rEFInd you could set up your UEFI to boot EFI/refind/refind_x64.efi by default.


----------



## balanga (Mar 12, 2021)

Snurg said:


> I would not consider rEFInd (~700 downloads/day) a "completely unknown and vague EFI bootmanager".
> LOL, you made my day


Isn't rEFInd the default bootmanager for PC-BSD / TruOS ?


----------

