# Booting FreeBSD kernel directly / Skipping loader



## eternal_noob (Feb 19, 2020)

Hi,

i have a dual-boot system which uses GRUB2 to directly load the FreeBSD kernel like this, skipping the loader:

```
menuentry "FreeBSD" {
    insmod ufs2
    set root=(hd0,3)
    kfreebsd /boot/kernel/kernel
    kfreebsd_loadenv /boot/device.hints
    set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ada0s3a
}
```

Now i've read https://www.freebsd.org/doc/handbook/boot-introduction.html and there is says:


> The loader will then read /boot/loader.rc, which by default reads in /boot/defaults/loader.conf which sets  reasonable defaults for variables



My Question is if this method of booting is a bad idea since it skips these settings of the "reasonable defaults"?

Is it better to not directly boot the kernel but using the loader?

```
menuentry "FreeBSD" {
    set root=(hd0,3)
    kfreebsd /boot/loader
}
```

I am confused


----------



## ralphbsz (Feb 19, 2020)

Normally, the loader boots the kernel. Why do you want to do something different? Do you have a good reason to go for the more complicated and unusual path?


----------



## eternal_noob (Feb 19, 2020)

ralphbsz said:


> Why do you want to do something different? Do you have a good reason to go for the more complicated and unusual path?


I thought it was redundant to load it via the FreeBSD boot loader since i am already using GRUB2 to boot stuff.

GRUB2 -> Linux kernel
vs.
GRUB2 -> FreeBSD boot loader -> FreeBSD kernel


----------



## SirDice (Feb 19, 2020)

freebsd_noob said:


> I thought it was redundant to load it via the FreeBSD boot loader since i am already using GRUB2 to boot stuff.


It's not. The loader(8) normally gets loaded by FreeBSD's own boot code (or manager). The entire boot process actually consists of three stages, loader(8) is the third and last stage before it loads the kernel. Grub basically replaces stage 1 and 2 of the boot process.

The menu you get to see (often referred to as "beasty menu") that provides options for single user mode, kernel selection etc, is also done by loader(8).


----------



## eternal_noob (Feb 19, 2020)

Thank you guys.

I am now using the

```
menuentry "FreeBSD" {
    set root=(hd0,3)
    kfreebsd /boot/loader
}
```

method of booting FreeBSD, in addition i added

```
beastie_disable="YES"
autoboot_delay="-1"
```
to the `/boot/loader.conf`.

Is there anything else i can disable when using GRUB2 to load the loader?


----------



## SirDice (Feb 19, 2020)

I remember some issues when you try to upgrade/update FreeBSD later on. For some reason the system can't figure out what kernel is active and will throw a weird error. I don't use Grub myself so I don't remember the exact details. But I believe you only needed to add a specific option to Grub in order to make it work correctly.


----------

