Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2007 15:36:38 +0200
From:      Ivan Voras <ivoras@fer.hr>
To:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD MBRs
Message-ID:  <fak2he$rqv$1@sea.gmane.org>
In-Reply-To: <46CC1DB7.7040506@cam.ac.uk>
References:  <46CC1DB7.7040506@cam.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig834E349DE4E3E6626BB09943
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Christopher Key wrote:

> I've a machine with 3 SATA drives.  The first (ad8) with a standard
> FreeBSD install in a single slice with /boot/boot0 MBR.  The remaining
> two drives (ad10, ad12) are in a RAID1 mirror with 3 slices, and used
> for storing data.  They have the /boot/mbr MBR.

Ok. Let's call them the "first (ad8), second (ad10) and third (ad12) drive"

> After booting off various USB flash drives to try and update the BIOS on
> my machine, it got into a state where during startup, it would display
> 'Missing operating system' and hang.  What seems to have been happening
> is that it was trying to boot from one of my data store drives, despite
> the boot order of the disks set in the BIOS.

Flashing the BIOS often resets all settings, including boot order. 
Depending on your BIOS, controller and motherboard, you might need to 
first select the active controller, then the drive on the controller. In 
your case, you need to finally tell BIOS to boot of the first drive (ad8).

Another thing that might be happening (though judging from what you said 
elsewhere it's not probable) is that the changed BIOS code enumerates 
devices differently than it used to, so ad8 is no longer the drive with 
boot0. This case will not hurt your RAID if you used gmirror, it might 
for other systems.

> The only solution that I found was to start booting from a USB flash
> drive with a boot0 MBR, and to hit F5 to change to booting from my first
> drive  After this, the machine then reboots quite happily until I hit F5
> again, in which case I get the same 'Missing operating behavior'.  This
> persists even while power cycling the machine.

Ok, so now you're booting from the first drive, and with F5 you're 
telling your boot loader to skip it and move on to the second drive, 
which has the standard mbr (this mbr is what's displaying the "Missing 
operating system" message).

> I had imagined the boot process to be entirely stateless, certainly
> across power cycles.  The BIOS executes the MBR on the first drive in
> its boot boot.  The boot0 MBR then allowed you to either execute the
> boot sector from any of the slices on the current drive, or to execute
> the MBR from the next drive in the list.

boot0 will by default remember what's the last option you booted from 
and use it as the default for the next time. It may not be the best 
thing for you, but I found it to be extremely useful behaviour in 
several cases, since it allowed me to "script" a boot order when the 
BIOS and the disk controller didn't get along for booting.

> However, this clearly isn't what's happening.  Is it boot0 remembering
> my F5 key stroke, or is it more likely that the BIOS is remembering
> something?  Does anyone have any recommendations to avoid this in the
> future?  Is putting boot0 on all three drives a good idea perhaps?

It will not hurt in any case to put boot0 on any drives (as long as you 
do it with the appropriate utility, else you may destroy the partition 
table). In your case, it will only be useless.

Here's something to try (I didn't try it): Do you have active partitions 
on the second and the third drive? If so, you might want to unmark them, 
and hopefully the boot loader won't display the drives in the boot menu. 
Maybe.

Or, if you're seriously worried about hitting F5 during boot, you might 
try an alternative boot loader such as sysutils/extipl or sysutils/grub.

--------------enig834E349DE4E3E6626BB09943
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGzY1tldnAQVacBcgRAvqeAJ46YpL603lbKMFpka8QaQUWbJ2/8gCfS/Th
B4uesmeKF2HH/yLPUtG0ZqY=
=4ELM
-----END PGP SIGNATURE-----

--------------enig834E349DE4E3E6626BB09943--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?fak2he$rqv$1>