From owner-freebsd-stable@freebsd.org Fri Oct 21 14:57:45 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 5585CC1A8E8 for ; Fri, 21 Oct 2016 14:57:45 +0000 (UTC) (envelope-from ardovm@yahoo.it) Received: from nm21-vm5.bullet.mail.ir2.yahoo.com (nm21-vm5.bullet.mail.ir2.yahoo.com [212.82.97.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E18BFDE for ; Fri, 21 Oct 2016 14:57:44 +0000 (UTC) (envelope-from ardovm@yahoo.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s2048; t=1477061715; bh=st91+1VnHe7bzv6w4sBnPzybjgH1nspQFiuJhe9sbGs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=eFPsTyuQOadak1Zlf9QXIizGU9JW2LbHkrniFvmv57tgKIEUWOlndCeFscTexNapT9COFO3uMXgzmtRzVsAvYk0L6PQDS5/iNthV9FEGFHEEyd94LFsx0GcRREwBOnRkT6HxCRzzfsB0b7pqFkCF+02lfj/9ZiwhwpDJpI7D0QhqKh31ZTD5i7fnMhljf9mLLmLI7Plqsszrmbyv8Z/iKylUHy4LRjeOO+vZ/TvhLBcuU57xrl+6k1OnOFfPXwO2ekUsGnS7EYwgZR9U0CBlHlAL05fxM70ze5JEGbZFRnI+DZTDd0trSJjF+1tKSMRbhvigRJyzlvWftZDuXSJAIw== Received: from [212.82.98.52] by nm21.bullet.mail.ir2.yahoo.com with NNFMP; 21 Oct 2016 14:55:15 -0000 Received: from [46.228.39.110] by tm5.bullet.mail.ir2.yahoo.com with NNFMP; 21 Oct 2016 14:55:15 -0000 Received: from [127.0.0.1] by smtp147.mail.ir2.yahoo.com with NNFMP; 21 Oct 2016 14:55:15 -0000 X-Yahoo-Newman-Id: 595006.76256.bm@smtp147.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: F8M7osoVM1nZdkBSWxZxeP.R9GpfQIXoTLAq3JFiQ8O3sSW IzBCEbTNdtg5frQhTXhajdsYqRIa7Q9Dw_awHse5fcnmOUDEq5WYfT.mDQFd cq.FnmfqsvH9wzOcefZSe.mQwX2i82SCTA9VxzSMX2bRv0c5THg7VAQ3H.B9 Rx7ErYLQDYYQOxHZ5UjqMo0IFj3CMBIiM6XuTjs8VpHDKXM2Fm_ZEGLesyTl joJei_gIyAWMa_QKHWuEhbATj1E_ckRbrO1tUlaNBxhq4OR2lPEckMzKkrqa G.wSBVn03AvaUxMP9geD4WFfxkPSlkx3beO8LCHoYw6yb2uhOFmmR7mkMSZS LRgdssMa5KhGjNTud6ozVkoK8yncGKSro9iu.2A9rt3rUG0zqWmZxtxIiIuo FdA9p2Ky3HI5IvE0r.vtevF239SNao84s4Ius0Xo2oV7iCKtmPITDOmqdSDw PjXgXC5f0U3Y3wPYg7W1j51es0Q8LB8Sr.3W4SBXN74cxz5p2oEvkxJnbB7H aIAr0U2gFVJGKRWo4MhA47NafjmeofmYJN1JCPUwFDHWd9FeB X-Yahoo-SMTP: WU.IBxeswBAAnLcBZV3tEZIK0A-- Received: by nuvolo.localdomain (Postfix, from userid 1001) id 55C141AF109; Fri, 21 Oct 2016 16:55:14 +0200 (CEST) Date: Fri, 21 Oct 2016 16:55:14 +0200 From: Arrigo Marchiori To: Warner Losh Cc: "Patrick M. Hausen" , freebsd-stable Subject: Re: boot0cfg on does not set default selection on gmirror device Message-ID: <20161021145514.GC1450@nuvolo> References: <14FD5FE6-6277-4EBE-8EE9-630A735F8BEA@punkt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) 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:57:45 -0000 Hello all, On Fri, Oct 21, 2016 at 08:41:33AM -0600, Warner Losh wrote: > 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? Ahem... For what it's worth... I cannot help not pointing this old PR out: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=186030 Best regards, -- rigo http://rigo.altervista.org