From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 17 16:39:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E61316A4CE for ; Tue, 17 Aug 2004 16:39:17 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1079743D1D for ; Tue, 17 Aug 2004 16:39:17 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i7HGdFXN080682 for freebsd-hackers@freebsd.org; Tue, 17 Aug 2004 11:39:15 -0500 (CDT) (envelope-from dan) Date: Tue, 17 Aug 2004 11:39:15 -0500 From: Dan Nelson To: freebsd-hackers@freebsd.org Message-ID: <20040817163915.GC53307@dan.emsphone.com> References: <20040817185240.A5554@oasis.uptsoft.com> <20040817161516.GB53307@dan.emsphone.com> <20040817192552.B5554@oasis.uptsoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040817192552.B5554@oasis.uptsoft.com> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i Subject: Re: actual boot device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2004 16:39:17 -0000 In the last episode (Aug 17), Sergey Lyubka said: > On Tue, Aug 17, 2004 at 11:15:16AM -0500, Dan Nelson wrote: > > In the last episode (Aug 17), Sergey Lyubka said: > > > How would one know the actual boot device after kernel > > > successfully booted ? > > > > The kern.bootfile sysctl points to the kernel file that was loaded, > > according to the loader. If you booted off of cdrom or floppy, you > > can run "kenv loaddev" to find out which device was actually used > > to read the file. > > I am booting kernel directly from bootblock, and do not have boot > loader, so kenv does not work. > > certainly, sysctl kern.bootfile points to /kernel, but it does not > tell anything. > > The actual device may be floppy, CF card or harrdisk, and I do not > have any means of figuring it out. The best you can do is search your mountpoints and see whether any of them has a "/kernel" file. The bootblock (and loader) uses the BIOS to read the kernel file, so it's possible that the device may not even be accessible from the running system. If, for example, you booted off a floppy but didn't have the floppy drivers in the kernel. -- Dan Nelson dnelson@allantgroup.com