From owner-freebsd-stable@freebsd.org Fri Oct 21 14:41:37 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B098C1A01E for ; Fri, 21 Oct 2016 14:41:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4975B171 for ; Fri, 21 Oct 2016 14:41:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id m138so168671324itm.0 for ; Fri, 21 Oct 2016 07:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=VNH46PtAv0LmXxquMTXcBCFhB2McOuFlvYm4TtS042g=; b=tZIiRl96T3dbk2WcO2JRkRZnbTYAbvSIyIVguLH9mZwQFckjL7lBQcIw1BrxI0eHfq BsYiF3mRrRn5Yr5a3T0nPiX3q9zCCLsinSVvSV3Ec5+TYaOPGLsUqo4U+HTEOLCgkNIT avmxfUtP1R60YS1sFBa9R3pfD+WIHn5Df72/avQ3xolqCeWw4d9bL23TQXiLibSaeGgR NJY2XpPxkpGl5KMYdArVmrMuUAC0FLIY8XvS8gXg94sRpkPmJsXfzUNZB1Ltcs6BxIzO jf2QI+WW7DQ16kNk2cDpstIQaam12QMOmfCM0deKcsr/t/ibmLlFnJKX8Jn5Uu6yED1i h8qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=VNH46PtAv0LmXxquMTXcBCFhB2McOuFlvYm4TtS042g=; b=Vm5etB4mnXAgkmhPkT405FhwC6xRECCfk2HNISzalcnY0Zi4qt40enM9HccMER9Oxq 1Xq/cUIWCQPsiVoW7r6JrAPqrBAq7O0uMp4ZJC2spBa/lMZgOPXq27/naUlIBPm4pUVM 7z5BaXWYwN+F+pE8JE+DEVYWPQnWwf9fla8JEH/OfggZqRaXxOubYySFwRra3eTgRfRu F3x+4L/YIUClHt5Xjp/AP/hBosQpwViLAAI3N+gjh++wEpdA6gQ9a02ipdRA6XM2cbng 2oWm7e8Spk7XHk5rJCOFK8AtuZL/68SOda23rc6L/0t28hxwPRDemycGRBAGEbu1zcZq /sUg== X-Gm-Message-State: ABUngvcvmnsBBLdPDKhR9/YsYX5k4NSVR2MFv4d6nV92ecmSAz6ulKpWY7sW4IPfbcvGY02BVkyg3ZCxM/3TmA== X-Received: by 10.36.53.214 with SMTP id k205mr1240342ita.85.1477060894231; Fri, 21 Oct 2016 07:41:34 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.77.85 with HTTP; Fri, 21 Oct 2016 07:41:33 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <14FD5FE6-6277-4EBE-8EE9-630A735F8BEA@punkt.de> References: <14FD5FE6-6277-4EBE-8EE9-630A735F8BEA@punkt.de> From: Warner Losh Date: Fri, 21 Oct 2016 08:41:33 -0600 X-Google-Sender-Auth: OTWgT5Z9-OZNMFF2SwnH8KYBAKA Message-ID: Subject: Re: boot0cfg on does not set default selection on gmirror device To: "Patrick M. Hausen" Cc: freebsd-stable Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2016 14:41:37 -0000 On Fri, Oct 21, 2016 at 5:39 AM, Patrick M. Hausen wrote: > Hi, all, > > we are repeatedly bitten by the following misbehaviour of boot0cfg: > > root@hd45:/usr/local # boot0cfg -s 1 mirror/m0 > root@hd45:/usr/local # boot0cfg -v mirror/m0 > # flag start chs type end chs offset size > 1 0x80 1: 0: 1 0xa5 1022:254:63 16065 16418430 > 2 0x00 1023: 0: 1 0xa5 1020:254:63 16434495 16418430 > 3 0x00 1021: 0: 1 0xa5 768:254:63 32852925 1920667140 > > version=1.0 drive=0x80 mask=0xf ticks=182 bell= (0x7) > options=packet,update,nosetdrv > default_selection=F2 (Slice 2) > > So, while it should have set the default to slice 1, it simply didn't. > > gpart on the other hand works as expected: > > root@hd45:/usr/local # gpart set -a active -i 1 mirror/m0 > active set on mirror/m0s1 > root@hd45:/usr/local # gpart show mirror/m0 > => 63 1953525104 mirror/m0 MBR (932G) > 63 16002 - free - (7.8M) > 16065 16418430 1 freebsd [active] (7.8G) > 16434495 16418430 2 freebsd (7.8G) > 32852925 1920667140 3 freebsd (916G) > 1953520065 5102 - free - (2.5M) > > But the "active" flag alone is not enough to convince boot0 to actually boot that partition. > > Additional info: > > root@hd45:/usr/local # uname -a > FreeBSD hd45.hosting.punkt.de 10.3-RELEASE-p10 FreeBSD 10.3-RELEASE-p10 #0 r306942: Mon Oct 10 10:29:14 UTC 2016 root@:/usr/obj/nanobsd.hosting/usr/src/sys/GENERIC amd64 > root@hd45:/usr/local # gmirror status > Name Status Components > mirror/m0 COMPLETE ada0 (ACTIVE) > ada1 (ACTIVE) > > > The only way to actually switch the boot0 default selection is: > > root@hd45:/usr/local # sysctl kern.geom.debugflags=16 > kern.geom.debugflags: 0 -> 16 > root@hd45:/usr/local # boot0cfg -s 1 ada0 > root@hd45:/usr/local # boot0cfg -s 1 ada1 > root@hd45:/usr/local # boot0cfg -v mirror/m0 > # flag start chs type end chs offset size > 1 0x80 1: 0: 1 0xa5 1022:254:63 16065 16418430 > 2 0x00 1023: 0: 1 0xa5 1020:254:63 16434495 16418430 > 3 0x00 1021: 0: 1 0xa5 768:254:63 32852925 1920667140 > > version=1.0 drive=0x80 mask=0xf ticks=182 bell= (0x7) > options=packet,update,nosetdrv > default_selection=F1 (Slice 1) > > > Any hints what's going on, here? Obviously it is possible to manipulate > the MBR of a gmirror device - as gpart proves. The boot0cfg pops up > since FreeBSD 8 when we started using a mirrored NanoBSD setup. Any chance you can migrate to using gpart? Is boot0cfg still referenced in NanoBSD somewhere? Warner