From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 15 17:54:54 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD463EC9 for ; Sat, 15 Dec 2012 17:54:54 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id 79A4D8FC13 for ; Sat, 15 Dec 2012 17:54:54 +0000 (UTC) Received: (qmail 23801 invoked by uid 0); 15 Dec 2012 17:54:47 -0000 Received: from 67.206.184.176 by rms-us004 with HTTP Content-Type: text/plain; charset="utf-8" Date: Sat, 15 Dec 2012 12:54:46 -0500 From: "Dieter BSD" Message-ID: <20121215175447.310780@gmx.com> MIME-Version: 1.0 Subject: Re: NetBSD's boot select MBR To: freebsd-hackers@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: MNy+cAIY3zOlNR3dAHAhSnJ+IGRvbwAI X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 17:54:54 -0000 Domagoj writes: > MBR supports max of 4 slices/partitions. 4 primary partitions, there are the "extended/logical partitions", which allow more. > The '/usr/mdec/mbr_bootsel', which you've mentioned, is equivalent > to FreeBSD's '/boot/boot0', which is tuned via 'boot0cfg' util. > It will also show menu, to choose from, a slice to boot or another > drive  OR => 'F6' to choose PXE boot. > If nothing has been selected, it will simply boot an active slice. > So I see FreeBSD's, as superior (additionally supports PXE) => 8.0 onward ... If I understand this correctly FreeBSD's boot0 allows you to set what to boot from the next time and go away while the system reboots. And this method allow booting from not only any slice but any disk, or PXE? But, it does this by writing to the MBR, yes? Some sysadmins want the MBR to be read-only for various reasons. OSes other than FreeBSD aren't going to have boot0cfg. If you're running NetBSD and want to boot Plan 9, do you have to reboot to FreeBSD, run boot0cfg, then reboot to Plan 9? As far as I know, NetBSD's MBR works with any combination of OSes. If the next OS to be booted is on the 1st disk and you don't mind writing to the MBR, you can do the set-and-walk-away thing by setting the active partition. Or you can use something like grub as the next stage and edit grub's default using any text editor, including sed in a script. If you want to boot a slice that is not on the first disk you have to either sit there and type at the menu, or use something like grub. As far as I know, NetBSD's MBR has no support for PXE, but then PXE is intended for diskless machines. > I thought NetBSD's had a MBR code, which could be told via a tool, > from fully booted and running FreeBSD: > "Active slice is 2, but please, boot slice 4 at a next boot". > After that, I would '# reboot' and without any menu, slice 4 > would be booted, for that one time, instaed of an active slice 2. I don't know of a way to do that with just NetBSD's MBR. You could either change the active flag which would remain that way until you changed it again, or sit there and watch for the menu. Given the limited space in the MBR it would be difficult or impossible to add that without giving up something. That feature could be added to a later stage bootstrap. Next time I build a boot disk I'm going to take another shot at multibooting with GPT. I really want to get away from the MBR kludgefest.