From owner-freebsd-questions@freebsd.org Thu Dec 10 04:06:03 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE0847365B for ; Thu, 10 Dec 2020 04:06:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cs0hW5nmDz4rTS for ; Thu, 10 Dec 2020 04:06:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id B3F38CC6 for ; Thu, 10 Dec 2020 04:06:03 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f172.google.com with SMTP id n142so3665052qkn.2 for ; Wed, 09 Dec 2020 20:06:03 -0800 (PST) X-Gm-Message-State: AOAM5334L3mH31csezI35d0AXL5RvJgFvcQfeSXBdWtrpIIozQtc1Ppn NUDgEG3qKYKfxULAVaq+V0PbY96G2/gBrAFj03w= X-Google-Smtp-Source: ABdhPJz2QxqXtxqmoe9Tu4048G9jpaSDMMA2wzohrvH5Xr/tEUHSEN0H35zgB525pQWJwNQrju6qAKGdZ3tVdaO0XyY= X-Received: by 2002:a05:620a:7e5:: with SMTP id k5mr5465469qkk.34.1607573163126; Wed, 09 Dec 2020 20:06:03 -0800 (PST) MIME-Version: 1.0 References: <86y2i6mrbh.fsf@elm.localnet> <86tusumjym.fsf@elm.localnet> In-Reply-To: <86tusumjym.fsf@elm.localnet> From: Kyle Evans Date: Wed, 9 Dec 2020 22:05:51 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Boot problems with a new system To: Carl Johnson Cc: FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2020 04:06:03 -0000 On Wed, Dec 9, 2020 at 9:14 PM Carl Johnson wrote: > > Kyle Evans writes: > > > On Wed, Dec 9, 2020 at 6:35 PM Carl Johnson 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" > >> kern.cam.ada.write_cache="0" > >> kern.cam.boot_delay="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: 1.) How many files and directories do you have directly in /boot? 2.) UEFI or BIOS? 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} FWIW- it's also been relatively slow on some of my systems, but I assumed I was the only one. :-) Thanks, Kyle Evans