# bootmanager confusion



## pestslent1 (Mar 22, 2019)

Those Man pages sometimes hurt my head.
I have a tri-boot system Windows, FreeBSD, Linux. I am using a windows Acronis bootloader (it works flawlessly). This is on MBR Disk
I wanted to check out TridentOS, (I understand this is FreeBSD but, please humor me.)
I want the BSD bootloader on the ZFS part ion I installed TridentOS on, I drove my self nuts trying to figure it out reading the Man pages and Googling it.
I look at GPART(8), it looks like I need to use something with  "*-p* _partcode" or am I suppose to _BOOT0CFG(8)   "boot0cfg -s 2 ada0"
Could someone please walk me threw how to do this using a FreeBSD install disk.

My layout is :  ada0 MBR
1 ntfs (windows)
2 freebsd
3 ebr (linux)


Thanks


----------



## D-FENS (Mar 22, 2019)

Edit: This does not apply to MBR but only to GPT!

You can install the boot loader by creating a 512kB partition of type "freebsd-boot". Then install the bootcode with gpart.
*Make sure you get the device names and partition indexes right! This can't be ephasized enough (I am writing this for myself).*
Assuming your disk is ada0 and the new partition has index 4:

```
# Add a 512k partition for the boot code:
# new partition index = 4
# Make sure the index is right! Otherwise, data in other partition will be wrecked!!!
gpart add -t freebsd-boot -b 40 -s 1024 -l gptboothdd0 ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 4 ada0
```


----------



## SirDice (Mar 22, 2019)

roccobaroccoSC said:


> You can install the boot loader by creating a 512kB partition of type "freebsd-boot".


This is for GPT only! MBR partitioned disks do not have a freebsd-boot partition.

The boot0cfg(8) only works for MBR and UFS. It's not possible to boot ZFS with it. Your best best on getting triple boot to work is by using Grub from Linux.


----------



## D-FENS (Mar 22, 2019)

oh, sorry. My bad


----------



## Vull (Mar 22, 2019)

But he doesn't have any GPT partitions. SirDice's suggestion should work without requiring any third party products.


----------

