From owner-freebsd-stable@freebsd.org Fri Oct 21 15:22:00 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 02656C1B299 for ; Fri, 21 Oct 2016 15:22:00 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (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 B8CE31723 for ; Fri, 21 Oct 2016 15:21:59 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 95E6528472; Fri, 21 Oct 2016 17:21:51 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id ACCD22846B; Fri, 21 Oct 2016 17:21:50 +0200 (CEST) Subject: Re: boot0cfg on does not set default selection on gmirror device To: Ian Smith , "Patrick M. Hausen" Cc: freebsd-stable References: <14FD5FE6-6277-4EBE-8EE9-630A735F8BEA@punkt.de> <20161022005837.G6806@sola.nimnet.asn.au> <20161022010007.U6806@sola.nimnet.asn.au> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <580A328E.4040504@quip.cz> Date: Fri, 21 Oct 2016 17:21:50 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: <20161022010007.U6806@sola.nimnet.asn.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 15:22:00 -0000 Ian Smith wrote on 2016/10/21 16:43: > On Fri, 21 Oct 2016 13:39:57 +0200, 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. > > boot0cfg isn't mirror-aware as such and thinks it's using BIOS services > to write to a specific drive, and likely did write to one of the disks, > but it seems gmirror isn't updating both disks' MBRs - which might not > be too surprising. Does it work 'sometimes'? We are using gmirror for whole drives mirroring from the time when it was introduced. It was always working with MRB/BSD. gmirror label gm0 ada0 ada1 And then you can use fdisk + bsdlabel or gpart to create slices and partitions and set it bootable on /dev/mirror/gm0. I didn't tried it with FreeBSD 10.3, but it works with 8.x (we skipped 9.x and all 8.x boxes were upgraded to 10.2 then 10.3) Miroslav Lachman