boot0cfg on does not set default selection on gmirror device

Warner Losh imp at bsdimp.com
Fri Oct 21 18:25:31 UTC 2016


On Fri, Oct 21, 2016 at 11:57 AM, Patrick M. Hausen <hausen at punkt.de> wrote:
> Hi, all,
>
>> Am 21.10.2016 um 16:41 schrieb Warner Losh <imp at bsdimp.com>:
>> Any chance you can migrate to using gpart? Is boot0cfg still
>> referenced in NanoBSD somewhere?
>
> Not in NanoBSD but how would you configure boot0's default
> slice with gpart? It doesn't pay attention to the "active" flag.
> See Miroslav's mails for all the details.
>
> gpart would only be an option if we did not use the FreeBSD
> boot manager.

Ah! OK, I thought this was the active flag issue, not the default in
boot0 issue.

> But we need the "F1 ..., F2 ..." prompt, because
> being able to roll back to the last known-good system via the
> console is the entire point of using this NanoBSD setup.
> There's a presentation on the EuroBSDCon 2010 page about
> motivation and setup. Wonder who did that talk ... :-)))

I think I sat in the talk :)

> BTW: thanks, Miroslav. As for your question: it does work on
> the only two systems that use hardware RAID, yet have a
> gmirror built of only a single component to get consistent
> device names accross all servers.
>
> I'm not quite sure if it works from time to time, I've come to
> accept the "kern.geom.debugflags" dance.
>
> I had opened a similar discussion years ago for 7.x/8.x and
> I was told that geom was to provide an API for fdisk, boot0cfg
> and friends to manipulate the MBR. Because back in the days
> boot0cfg and fdisk both threw an error message when trying
> to work on a whole-disk mirror.

It certainly looks like this code has that conversion in it. Looks
like it's been there quite a while. I'd have expected it to "JUST
WORK" [tm].

> I thought that was long solved - at least no error, anymore.
> But it's still not working in 10.x.

Can you give us the strace output?

It looks like it is reading the current blocks, setting the options,
and then writing it back to the device. If the write back fails, it
opens the device with geom and sends either the bootcode verb to geom
(for the PART (aka gpart)) case or the data for the MBR case. strace
should show that clearly. There's nothing in dmesg, right? Try this
again but set geom.debug_flags to 128 instead of 16. This will give a
verbose error in dmesg if there's any errors from the control message.

Warner


More information about the freebsd-stable mailing list