# Installing FreeBSD: Auto (ZFS) + MBR (BIOS) = "Missing operating system"



## Vurefozu (Nov 16, 2022)

Hello.
Trying to install FreeBSD 13.1-Release (FreeBSD-13.1-RELEASE-amd64-disc1.iso) with configuration:
Partitioning: Auto (ZFS)
Partition Scheme: MBR (BIOS)
Pool Type/Disks: stripe: 1 disk

And I found that after the first reboot the system does not boot and a message is displayed: "Missing operating system"

Tested 3 times:
- on PC
- on the XEN virtual machine
- on QEMU virtual machine

In all three cases, the problem is reproduced.
Why is this happening? Is this a bug with the freebsd installer or is there something else I need to do?
Thank you.


----------



## SirDice (Nov 16, 2022)

Why use MBR in the first place? On systems younger than about 10 years you can safely use GPT, even if you're still on the traditional BIOS boot. I would recommend using GPT (UEFI+BIOS) on modern systems, even if your current system isn't capable of UEFI booting.


----------



## Vurefozu (Nov 16, 2022)

SirDice said:


> Why use MBR in the first place?


Just an old habit.

I have now switched to GPT. But I would like to understand why freebsd is not loaded from the installer.

If these are installer errors, then I will know this and suggest removing this item from the installer so that other users do not stumble upon this problem.


----------



## covacat (Nov 16, 2022)

looks like missing bootcode
MBR + ZFS on root should be removed from the installer (in my opinion)
you can probably still boot it by using this guide https://wiki.freebsd.org/RootOnZFS/ZFSBootSlice


----------



## SirDice (Nov 16, 2022)

Vurefozu said:


> But I would like to understand why freebsd is not loaded from the installer.


MBR _should_ work. "Missing operating system" usually indicates it's a BIOS issue, not booting from the correct disk for example.


----------



## covacat (Nov 16, 2022)

"Missing operating system" message is usually contained in the standard mbr code and displayed more often than not when you dont have an active partition or the bootcode of the active partition is missing the 0x55 0xAA signature
(or something)


----------



## SirDice (Nov 16, 2022)

I'm wondering if there's still enough space for the ZFS bootcode in the slice/partition with MBR. It seems to have grown a lot the last few years.


----------



## covacat (Nov 16, 2022)

the problem/thing is that is not even a partition; you just dd the code in a specific place inside the actual fs space
from the wiki above
zpool create zroot /dev/ad0s3
dd if=/mnt2/boot/zfsboot of=/dev/ad0s3 skip=1 seek=1024


----------



## SirDice (Nov 16, 2022)

covacat said:


> the problem/thing is that is not even a partition; you just dd the code in a specific place inside the actual fs space


Sure, but that space still needs to be large enough and not get overwritten by the filesystem you're putting on it.


----------



## covacat (Nov 16, 2022)

SirDice said:


> Sure, but that space still needs to be large enough and not get overwritten by the filesystem you're putting on it.


yeah, its worse than a partition, you don't know how big the internal reservation is and what you may fsck up if you update the bootcode


----------



## SirDice (Nov 16, 2022)

covacat said:


> you don't know how big the internal reservation is and what you may fsck up if you update the bootcode


Yes, exactly. Or the filesystem overwriting the tail end of your bootcode.


----------



## Vurefozu (Nov 17, 2022)

covacat said:


> you can probably still boot it by using this guide https://wiki.freebsd.org/RootOnZFS/ZFSBootSlice


Thank you. This method is working. Installed from scratch manually, booted.



covacat said:


> MBR + ZFS on root should be removed from the installer (in my opinion)


Because According to the instructions https://wiki.freebsd.org/RootOnZFS/ZFSBootSlice, I managed to install it manually on ZFS + MBR (BIOS), which means that the freebsd installer does not install something correctly.


----------



## SirDice (Nov 17, 2022)

It's certainly possible the installer is broken in this regard. Most people don't use MBR anymore so it probably hasn't been tested extensively. If you want to have this fixed open a PR for it: https://bugs.freebsd.org/bugzilla/


----------



## vermaden (Nov 17, 2022)

Vurefozu said:


> Hello.
> Trying to install FreeBSD 13.1-Release (FreeBSD-13.1-RELEASE-amd64-disc1.iso) with configuration:
> Partitioning: Auto (ZFS)
> Partition Scheme: MBR (BIOS)
> ...


Try other thing.

Install FreeBSD with Auto (ZFS) with GPT scheme and then still boot in BIOS mode. That works.

I tried several times with ZFS on MBR but was never able to boot from it.


----------



## Vurefozu (Nov 17, 2022)

vermaden said:


> Install FreeBSD with Auto (ZFS) with GPT scheme and then still boot in BIOS mode. That works.


Yes, I tried, GPT (BIOS) option works.


----------



## free-and-bsd (Nov 17, 2022)

Some time ago I tried a "whole disk ZFS" option. That is a pool that uses a whole unpartitioned disk. Later I noticed that it DID use MBR. But in that particular case, GRUB2 for MBR worked perfectly well. Later I abandoned that setup as it didn't show any advantage over partitioned approach...


----------



## Vurefozu (Nov 18, 2022)

FreeBSD Bugzilla – PR 267843


----------

