# Preboot Menu



## fr33bsd (Aug 21, 2021)

Hi,

how is the preboot menu that can show up *before* the "welcome to freebsd - menu" on boot up configured? What is the name of its config file?

The menu contains 3 options: F1 for FreeBSD, F5 for Drive 1 and F6 for PXE.


----------



## Argentum (Aug 21, 2021)

fr33bsd said:


> how is the preboot menu that can show up *before* the "welcome to freebsd - menu" on boot up configured? What is the name of its config file?
> 
> The menu contains 3 options: F1 for FreeBSD, F5 for Drive 1 and F6 for PXE.


This probably depends on your motherboard. Newer MB-s have even UEFI shell with many commands. You can run this before the actual FreeBSD boot starts.


----------



## fr33bsd (Aug 21, 2021)

Nah, I think it is the menu of *boot0cfg*()


----------



## fr33bsd (Aug 21, 2021)

fr33bsd said:


> Nah, I think it is the menu of *boot0cfg*()


I cannot reduce ticks to zero to turn off wait time. Parameter `-t 0` does not work.


----------



## fr33bsd (Aug 21, 2021)

fr33bsd said:


> I cannot reduce ticks to zero to turn off wait time. Parameter `-t 0` does not work.


Ah, it can be reduced by `-t 1` But it still occures. I even tried `boot0cfg <device>`, but the menu still occures.


----------



## leebrown66 (Aug 21, 2021)

boot0cfg(8) explains how to make it non-interactive, if that is your goal.


----------



## fr33bsd (Aug 21, 2021)

leebrown66 said:


> boot0cfg(8) explains how to make it non-interactive, if that is your goal.





> To    go back    to non-interactive booting, use    gpart(8) to install the    de-
> fault MBR:
> 
> gpart bootcode -b /boot/mbr ada0


Tried it already. It kills the working boot up device.


----------



## leebrown66 (Aug 21, 2021)

Assuming this is bsdlabel on MBR, is the active partition correctly set? (`gpart set -a active`)
I have not used bsdlabel/MBR since GPT became available, so I'm not really familiar with this anymore.


----------



## fr33bsd (Aug 21, 2021)

i did
`fdisk -BI /dev/ada0
bsdlabel -B -w ada0s1
newfs -U -O1 /dev/ada0s1a
boot0cfg -v -B -t1 ada0`
and it works that far until 
`gpart bootcode -b /boot/mbr ada0`


----------



## leebrown66 (Aug 21, 2021)

Is fdisk/bsdlabel a hard requirement?  Personally I would switch to GPT, ideally with EFI, but that's my comfort zone and I know some legacy equipment won't understand GPT.


----------



## Alexander88207 (Aug 21, 2021)

fr33bsd said:


> I cannot reduce ticks to zero to turn off wait time. Parameter `-t 0` does not work.



Hello,

if you mean the wait time on the boot screen add `autoboot_delay="0"` to /boot/loader.conf.


----------



## fr33bsd (Aug 22, 2021)

Alexander88207 said:


> Hello,
> 
> if you mean the wait time on the boot screen add `autoboot_delay="0"` to /boot/loader.conf.


The boot load menu boot0cfg deploys is meant, but this is also useful to reduce boot time


----------



## SirDice (Aug 23, 2021)

boot0cfg(8) only works on MBR partitioned disks and can only boot FreeBSD from UFS. And no, it cannot be extended to include ZFS. There simply isn't enough room to fit ZFS support in there.


----------



## covacat (Aug 23, 2021)

SirDice said:


> boot0cfg(8) only works on MBR partitioned disks and can only boot FreeBSD from UFS. And no, it cannot be extended to include ZFS. There simply isn't enough room to fit ZFS support in there.


actually boot0cfg code is fs agnostic
it just loads the first sector of the selected partition and executes the code 
i remember i had and 8.x system that was mbr and booted zfs
you had to dd zfs bootcode to the start of pool providers (was messy enough anyway)


----------

