Boot problems with a new system

Carl Johnson carlj at
Thu Dec 10 05:10:10 UTC 2020

Kyle Evans <kevans at> writes:

> On Wed, Dec 9, 2020 at 9:14 PM Carl Johnson <carlj at> wrote:
>> Kyle Evans <kevans at> writes:
>> > On Wed, Dec 9, 2020 at 6:35 PM Carl Johnson <carlj at> wrote:
>> >>
>> >> Hello,
>> >>
>> >> I have a new system that I have installed FreeBSD 12.2-RELEASE (amd64)
>> >> onto, but it won't boot back from the disk.  It installed properly and
>> >> it has booted a couple of times, but lately it always hangs in the
>> >> middle of the boot loader menu.  It always prints the first five menu
>> >> entries, but then hangs when it should print out the kernels that are
>> >> available.  I can still boot with the memstick and "zfs import" the
>> >> pool, and the pool appears fine.  I have tried searching the web, but
>> >> haven't found anything that helps.
>> >>
>> >> These are all loader.conf settings I have tried that don't help:
>> >> vfs.zfs.cache_flush_disable="1"
>> >>"0"
>> >>"5000"
>> >> loader_delay="3"
>> >> boot_verbose="YES"
>> >> verbose_loading="YES"
>> >>
>> >
>> > Try adding:
>> >
>> > kernels_autodetect="NO"
>> >
>> > Thanks,
>> >
>> > Kyle Evans
>> Thanks Kyle,
>> It boots perfectly with that line present.  I commented out the other
>> test lines and it still boots consistently, but still hangs without the
>> autodetect line.  Is there something else I should be doing, or just
>> leave it like this?
> Excellent! You're likely not getting any value out of the feature, so
> just leaving it there is fine -- I do have some follow-up questions,
> though:

Leaving it this way is fine with me.

> 1.) How many files and directories do you have directly in /boot?
> 2.) UEFI or BIOS?

This is a new installation of 12.2-RELEASE from the memstick image, so
it only has the standard files and directories now.  That looks like 3
empty directories (modules, firmware, and dtb), and the kernel, lua,
zfs, and defaults directories.  Then there are about 55 other files in
/boot itself.

It has an EFI partition, so it appears to be an EFI install.

> Looking at the code for this again, the best we can likely do to
> improve the default behavior is to add a "strict" option for
> kernels_autodetect that only checks directories starting with 'kernel'
> for kernels and default to that. This would drastically lower the
> number of stat calls we do by default and works for the vast majority
> of people that probably only have kernels in /boot/kernel,
> /boot/kernel.old, and maybe /boot/kernel.${kernconf}

I would definitely be in that vast majority.

> FWIW- it's also been relatively slow on some of my systems, but I
> assumed I was the only one. :-)
> Thanks,
> Kyle Evans

Thanks again Kyle.

Carl Johnson		carlj at

More information about the freebsd-questions mailing list