-
-
Notifications
You must be signed in to change notification settings - Fork 6
UEFI GPT Booting
Complications with MidnightBSD booting on modern hardware.
MidnightBSD 2.x has support for booting off GPT partitions in a UEFI system. There are some caveats, though.
The installer does not copy the bootloader to your system EFI partition. You need to do this manually.
You can boot MidnightBSD with CSM enabled in the BIOS without doing this step. When using CSM, the mnbsd-boot partition is used instead.
For example, say you have an AMD Ryzen 3950x with a 6900XT. You want to dual-boot MidnightBSD and Windows 11 on the system using 2 SSDs.
Install Windows 11 first.
Install MidnightBSD with GPT.
Boot into MidnightBSD.
mkdir /boot/efi
echo '/dev/ada0p1 /boot/efi msdosfs rw,noatime 0 0' >> /etc/fstab
mount /boot/efi
mkdir /boot/efi/EFI/midnightbsd
cp /boot/boot1.efi /boot/efi/EFI/midnightbsd/bootx64.efi
NOTE: for older installs (e.g. MidnightBSD 2.x)
mount -t msdosfs /dev/partition-name /mnt
cp /boot/loader.efi /mnt/efi/boot/bootx64.efi
umount /mnt
You must also register this with efibootmgr or using another tool in windows.
You can do this much easier in Windows 11. Download a tool called Hasleo EasyUEFI.
Create a new menu entry for MidnightBSD that points to EFI/midnightbsd/bootx64.efi
Install rEFInd by using the EasyUEFI tool. Upload it to EFI/refind. Create a menu entry pointed at the rEFInd x64 boot file. Set that as the FIRST entry in the boot manager editor screen in EasyUEFI.
Now rEFInd will find MidnightBSD and Windows and let you choose between them.
This also allows you to disable CSM on some motherboards in UEFI. By doing this, you can enable rebar/SAM to get full speed out of your AMD, nvidia or Intel graphics adapter in Windows.
Linux/BSD setup option Here are instructions from a blog post on doing this in Linux/FreeBSD env.
efibootmgr -c -l /boot/efi/EFI/midnightbsd/bootx64.efi -L "MidnightBSD"
efibootmgr efibootmgr -a 15
efibootmgr -o 14,15
General YouTube videos about installing it. (doesn't focus on BSD, though)
https://www.youtube.com/watch?v=xRZab8yrSOQ&t=238s