nanobsd boot slice selection does not work

John Baldwin jhb at freebsd.org
Wed May 13 14:27:31 UTC 2009


On Tuesday 12 May 2009 6:13:42 pm Paul Schenkeveld wrote:
> During reboot, boot0 suggests that slice 2 is default:
> 
>    1 Seconds to automatic boot.   Press Ctrl-P for entering Monitor.
> 
>    1   FreeBSD
>    2   FreeBSD
>    5   Drive 1
> 
>    Boot:   2
> 
> It looks like the kernel on ad0s1a gets loaded however.  To be sure I
> upgraded the kernel on ad0s2a with a newer one, still the same behaviour.

Can you do boot0cfg -v after you have rebooted in this case?  I want to see if 
the active flag is set to slice 2.
 
> To summarize 7.2 boot0 behaviour:
> 
>   - Pressing [F]1 or [F]2 at the boot0 prompt selects slice 1 or 2 and
>     boots off that slice.  If the update option is on, default_selection
>     is set in sector0, the active flage is set on the requested slice
>     and cleared from the other slice.

Ok, so pressing the key always works?

>   - Boot0cfg -s N sets default_selection to N and does not affect the
>     active flag in MBR record.

Right, the way this works at least in <= 7.1 is that boot0 changes the active 
flag based on 'default_selection' and then writes the new MBR back out to 
disk.

>   - Boot0 does not look at default_selection at all, the slice marked
>     active is booted, if no slice is marked active, slice 1 is booted.

Well, boot1 does not look at default_selection at all.  I think boot0 is still 
honoring it, but what happens is that boot0 loads boot1 from slice 2, but 
that boot1 doesn't find the active flag set, so it uses the first FreeBSD 
slice (slice 1) to load boot2, the loader, and the kernel.

-- 
John Baldwin


More information about the freebsd-embedded mailing list