Dual boot with Windows 10

Hi,

I just read Thread 59427, and I wondering if the only way to have dual boot between FreeBSD (11.0-RELEASE) and Windows 10 is with grub.
In my case, I already installed Windows 10 several months ago; today I installed FreeBSD on another partition, and I would like to boot both OS... just in case :) :)
Thank you!
 
I am dual booting Windows 10 and FreeBSD 11.0-RELEASE using only the FreeBSD boot loader.

You can figure out what slices are used by issuing a gpart show
My Windows slice was 1, and FreeBSD was 3.
  • Install bootloader with slices 1 and 3 available: boot0cfg -B -s 1 -s 3 [disk]
  • Enable only slices 1 and 3 in bootloader: boot0cfg -m 0x5 [disk]
 
I am doing dual booting of Windows 10 and FreeBSD 11.0-RELEASE on a headless machine without any boot menu.

From the FreeBSD perspective the partition scheme looks as follows:
# gpart show
Code:
=>       63  312581745  ada0  MBR  (149G)
         63  156364767     1  ntfs  (75G)
  156364830       2018        - free -  (1.0M)
  156366848     919552     2  !39  (449M)
  157286400         30        - free -  (15K)
  157286430  155295378     3  freebsd  [active]  (74G)

=>        0  155295378  ada0s3  BSD  (74G)
          0  146800640       1  freebsd-ufs  (70G)
  146800640    8494738       2  freebsd-swap  (4.0G)
Windows 10 resides on the NTFS partition ada0s1 and FreeBSD is installed on ada0s3a. For re-starting the system with Windows 10, as superuser I execute the following shell script which I stored at /root/bin/startwin:
Code:
#!/bin/sh
gpart set -a active -i 1 ada0
shutdown -r now
On the Windows side, I created a batch file named startbsd.bat which essentially does the same, only into the other direction:
Code:
diskpart /s C:\Users\rolf\dp_active_p3.txt
shutdown /r /t 0
The file C:\Users\rolf\dp_active_p3.txt contains:
Code:
select disk 0
select partition 3
active
startbsd.bat must be called with administrative rights, i.e. right-click on it and select Execute as Administrator.
 
For the time being on my UEFI system I use the firmware boot menu (press key during POST) to boot FreeBSD and the Windows bootmanager to boot Windows 7 / Windows 10. My attempts to boot FreeBSD using the Windows boot manager (as I was doing on BIOS/MBR based systems) have so far been unsuccessful. FreeBSD was installed via manual install, FreeBSD's EFI bootloader was copied over to a separate folder on the ESP and if I remember it correctly, I had to create an entry for it using Windows' bcdedit utility:

Code:
Windows Boot Manager
--------------------
identifier              {f4254db9-0bae-11e6-bddd-1c872c606d1f}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\FREEBSD\BOOT1.EFI
description             FreeBSD
locale                  en-US
inherit                 {globalsettings}
Now I can press F8 key during POST and select FreeBSD from a list.
 
For the time being on my UEFI system I use the firmware boot menu (press key during POST) to boot FreeBSD and the Windows bootmanager to boot Windows 7 / Windows 10. My attempts to boot FreeBSD using the Windows boot manager (as I was doing on BIOS/MBR based systems) have so far been unsuccessful. FreeBSD was installed via manual install, FreeBSD's EFI bootloader was copied over to a separate folder on the ESP and if I remember it correctly, I had to create an entry for it using Windows' bcdedit utility:

Code:
Windows Boot Manager
--------------------
identifier              {f4254db9-0bae-11e6-bddd-1c872c606d1f}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\FREEBSD\BOOT1.EFI
description             FreeBSD
locale                  en-US
inherit                 {globalsettings}
Now I can press F8 key during POST and select FreeBSD from a list.


These directions worked great for me. I wish I had seen this post before I installed, because now I have a bonus EFI partition after my Windows partition. I just had to copy the contents from that EFI partition to the one on p1. Then I booted into windows and opened an administrator powershell and ran:
Code:
bcdedit /copy "{bootmgr}"
Then I took note of the identifier it gave for the copy; mine was {6be48d15-ccc2-11e7-9de8-54e1ad7c69e8}. Then I edited the description and the path.
Code:
bcdedit /set "{6be48d15-ccc2-11e7-9de8-54e1ad7c69e8}" path \EFI\FREEBSD\BOOTX64.EFI
bcdedit /set "{6be48d15-ccc2-11e7-9de8-54e1ad7c69e8}" description FreeBSD

Then I could just pull up the boot menu and choose FreeBSD. Unfortunately I am missing 200mb that I could potentially use, but that will be something I fix another day.
 
Back
Top