From owner-freebsd-stable@freebsd.org Fri Oct 21 12:02:06 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 DE51FC1BBEB for ; Fri, 21 Oct 2016 12:02:06 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from kagate.punkt.de (kagate.punkt.de [217.29.33.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EAE3EB9 for ; Fri, 21 Oct 2016 12:02:06 +0000 (UTC) (envelope-from hausen@punkt.de) Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [217.29.44.10]) by gate2.intern.punkt.de with ESMTP id u9LBdZlO036282 for ; Fri, 21 Oct 2016 13:39:35 +0200 (CEST) Received: from [217.29.44.206] ([217.29.44.206]) by hugo10.ka.punkt.de (8.14.2/8.14.2) with ESMTP id u9LBdYUn044121 for ; Fri, 21 Oct 2016 13:39:34 +0200 (CEST) (envelope-from hausen@punkt.de) From: "Patrick M. Hausen" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: boot0cfg on does not set default selection on gmirror device Message-Id: <14FD5FE6-6277-4EBE-8EE9-630A735F8BEA@punkt.de> Date: Fri, 21 Oct 2016 13:39:57 +0200 To: freebsd-stable Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) 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 12:02:07 -0000 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=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) options=3Dpacket,update,nosetdrv default_selection=3DF2 (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 =3D> 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=3D16 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=3D1.0 drive=3D0x80 mask=3D0xf ticks=3D182 bell=3D (0x7) options=3Dpacket,update,nosetdrv default_selection=3DF1 (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. Thanks and kind regards, Patrick --=20 punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe Tel. 0721 9109 0 * Fax 0721 9109 100 info@punkt.de http://www.punkt.de Gf: J=C3=BCrgen Egeling AG Mannheim 108285