# Missing operating system



## balanga (Feb 13, 2018)

In the process of trying to migrate from mbr to gpt, I gpt partitioned a new disk yesterday and created a number of partitions, installed FreeBSD and later installed Arch Linux. FreeBSD booted up successfully initially.  As part of the Arch Linux installation, I installed Grub, but it did not show up on reboot. Instead the normal FreeBSD bootloader came up. I then ran boot0cfg()  hoping the FreeBSD Boot Manager would provide boot options for both, but it provide a couple of options, neither of which worked.

Next I tried to restore the original FreeBSD boot loader using:-


```
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada0
```

This resulted in *Missing operating system* when starting the system.

If I boot from a Grub USB stick it finds both oses and both boot OK.

What did I do wrong?


----------



## SirDice (Feb 13, 2018)

Make sure the freebsd-ufs partition (with the root filesystem) has the bootme flag set. See the BOOTING section of gptboot(8).


----------



## balanga (Feb 13, 2018)

I tried that but it made no difference. Ended up installing sysutils/grub2-efi and that got me sorted.


----------

