From owner-freebsd-questions@FreeBSD.ORG Wed Mar 5 20:51:21 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0FF21065675 for ; Wed, 5 Mar 2008 20:51:21 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.freebsd.org (Postfix) with ESMTP id BEB2A8FC1B for ; Wed, 5 Mar 2008 20:51:21 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.2/8.14.2) id m25KpJkL095903; Wed, 5 Mar 2008 14:51:19 -0600 (CST) (envelope-from dan) Date: Wed, 5 Mar 2008 14:51:19 -0600 From: Dan Nelson To: Daniel Feenberg Message-ID: <20080305205118.GA2046@dan.emsphone.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 7.0-PRERELEASE User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-questions@freebsd.org Subject: Re: faster booting X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2008 20:51:22 -0000 In the last episode (Mar 05), Daniel Feenberg said: > We have several network services hosted on a FreeBSD system, and want > it to come up quickly, so that these services (dhcp, nameservice, > nis, tftp etc) are available when systems are restarting after a > prolonged power failure. > > That is, several times a year we have multi-hour power failures > (generally starting at midnight because that is utility maintainance > time) and our UPSs run out of power. That is OK, but we would like > the systems to come up when the power returns, without going to the > server room and restarting systems in a prescribed order. > > In most cases the clients hang because essential services are not > available, and in most cases the clients do not proceed to boot later > when the service does become available. > > So, is there advice anywhere about speeding up the boot process? It > appears that most of the 1 minute 45 seconds to boot our system is > wait time for checking the existence of non-existant hardware and > would not be appreciable reduced with a faster CPU or disk. Are there > kernel options that we could use to avoid this checking? Would > recompiling the kernel in some specialized way help? Would pico-bsd > be faster? If it's a PCI system, removing unused drivers can't hurt, but if a driver doesn't find a supported PCI ID on the system is usually exits immediately. But removing drivers for hardware that you have but don't use might help more. I know it takes a few seconds to scan for USB devices even if none are connected, for example. You can also set "kern.cam.scsi_delay=500" in loader.conf to take the settling time for SCSI devices down to .5 sec instead of 2 sec per bus. There's probably a similar tunable for IDE/SATA controllers. Best thing to do is watch the console and eliminate drivers (or adjust timeouts) that seem to cause the scrolling to stop :) > About the only thing I can find is to reduce the 10 second boot screen > delay - but we need to cut more than 30 seconds. There might actually be three boot delays: one from boot0 (the F1,F2,F3 boot menu), boot2 (the bootblock that loads /boot/loader), and the loader. You can remove the boot0 timeout with "boot0cfg -t 0" or simply replace it with a dumb mbr with "fdisk -B". boot2 can be sped up by creating a boot.config file in your root directory with "-n" in it, and you alreay know how to reduce /boot/loader's timeout. Some of this is documented in the boot0cfg(8) and boot(8) manpages. -- Dan Nelson dnelson@allantgroup.com