Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Dec 2013 09:08:08 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Mathieu Arnold <mat@FreeBSD.org>
Cc:        Thomas Hoffmann <trh411@gmail.com>, freebsd-stable@freebsd.org, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: FreeBSD 10.0-RC3 Now Available
Message-ID:  <alpine.BSF.2.00.1312270859430.32365@wonkity.com>
In-Reply-To: <38B0C411B75D7482B92033D2@ogg.in.absolight.net>
References:  <20131226162521.GK2009@glenbarber.us> <CA%2BWntOt26JXT3Bh8ccSM-fQ726c2Hy3F06n2iDbu3pLBXjn-AA@mail.gmail.com> <20131226212158.GD13109@glenbarber.us> <CACuV5sCjjsjFK9AjJ7saRPpDktwxf1rd6a-M2FKXXYf-EaBy2w@mail.gmail.com> <BCB09816844D0B52B1EFE964@atuin.in.mat.cc> <CACuV5sD2Cw=iZ=uE8BjcV6j8-Bc8ppChQ=ZPKZ7uFTXQLmhCxQ@mail.gmail.com> <2F6DABD655B7C3230EC0F15D@ogg.in.absolight.net> <CAB7-odmH-b=%2B_-BwF1jt7EMdTxpK-P%2Bw%2Bp6Ce9-k7mRvXpLzog@mail.gmail.com> <38B0C411B75D7482B92033D2@ogg.in.absolight.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Dec 2013, Mathieu Arnold wrote:

> +--On 27 décembre 2013 10:28:07 -0500 Thomas Hoffmann <trh411@gmail.com>
> wrote:
> | All the examples I've seen for updating bootcode assume GPT. If one has
> | MBR (as I do) and assuming the following basic scheme:
> |
> | gpart show ada0
> | =>       63  976773105  ada0  MBR  (466G)
> |          63  976773105     1  freebsd  [active]  (466G)
> |
> | gpart show ada0s1
> | =>        0  976773105  ada0s1  BSD  (466G)
> |           0  943218736       1  freebsd-zfs  (450G)
> |   943218736   33554369       2  freebsd-swap  (16G)
> |
> | would the equivalent bootcode statement be:
> |
> | gpart bootcode -b /boot/pmbr -p /boot/zfsboot ada0s1

No, the PMBR is for GPT partitioning only.

> | where the boot code is /boot/zfsboot (rather than /boot/gptzfsboot) and
> | ada0s1 is the slice on which FreeBSD is installed?
>
> Hum, no, if you're using MBR and not GPT, you can't use gpart,

Why not?  gpart is not GPT-specific.  It handles MBR and BSDlabel 
bootcode correctly.

> you have to
> do something aweful like this :
> # dd if=/boot/zfsboot of=/dev/ada0 count=1

That will overwrite the MBR partition table.

> # sysctl kern.geom.debugflags=0x10
> # dd if=/boot/zfsboot of=/dev/ada0 skip=1 seek=1024

That seems dangerous.  I have not tried with zfsboot, but this should be 
close:

   # gpart bootcode -b /boot/zfsboot ada0
   # gpart bootcode -b /boot/zfsboot ada0s1

Untested!  The first one may need to use /boot/mbr.  A better way to do 
this, provided the system does not have a broken BIOS, would be to 
backup, repartition with GPT, and restore, avoiding the complication of 
multiple partitioning schemes.
From owner-freebsd-stable@FreeBSD.ORG  Fri Dec 27 16:17:22 2013
Return-Path: <owner-freebsd-stable@FreeBSD.ORG>
Delivered-To: freebsd-stable@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 9251ADBE;
 Fri, 27 Dec 2013 16:17:22 +0000 (UTC)
Received: from thyme.infocus-llc.com (server.infocus-llc.com [206.156.254.44])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 62F561ABC;
 Fri, 27 Dec 2013 16:17:21 +0000 (UTC)
Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net
 [75.65.60.66])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by thyme.infocus-llc.com (Postfix) with ESMTPSA id 4907D37B596;
 Fri, 27 Dec 2013 10:17:15 -0600 (CST)
Received: by draco.over-yonder.net (Postfix, from userid 100)
 id 3drY8V5S82zKfJ; Fri, 27 Dec 2013 10:17:14 -0600 (CST)
Date: Fri, 27 Dec 2013 10:17:14 -0600
From: "Matthew D. Fuller" <fullermd@over-yonder.net>
To: Mathieu Arnold <mat@FreeBSD.org>
Subject: Re: FreeBSD 10.0-RC3 Now Available
Message-ID: <20131227161714.GF99219@over-yonder.net>
References: <20131226162521.GK2009@glenbarber.us>
 <CA+WntOt26JXT3Bh8ccSM-fQ726c2Hy3F06n2iDbu3pLBXjn-AA@mail.gmail.com>
 <20131226212158.GD13109@glenbarber.us>
 <CACuV5sCjjsjFK9AjJ7saRPpDktwxf1rd6a-M2FKXXYf-EaBy2w@mail.gmail.com>
 <BCB09816844D0B52B1EFE964@atuin.in.mat.cc>
 <CACuV5sD2Cw=iZ=uE8BjcV6j8-Bc8ppChQ=ZPKZ7uFTXQLmhCxQ@mail.gmail.com>
 <2F6DABD655B7C3230EC0F15D@ogg.in.absolight.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2F6DABD655B7C3230EC0F15D@ogg.in.absolight.net>
X-Editor: vi
X-OS: FreeBSD <http://www.freebsd.org/>;
User-Agent: Mutt/1.5.22 (2013-10-16)
X-Virus-Scanned: clamav-milter 0.98 at thyme.infocus-llc.com
X-Virus-Status: Clean
Cc: Zenny <garbytrash@gmail.com>, freebsd-current <freebsd-current@freebsd.org>,
 freebsd-stable@freebsd.org
X-BeenThere: freebsd-stable@freebsd.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Production branch of FreeBSD source code <freebsd-stable.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-stable>,
 <mailto:freebsd-stable-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-stable/>;
List-Post: <mailto:freebsd-stable@freebsd.org>
List-Help: <mailto:freebsd-stable-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-stable>,
 <mailto:freebsd-stable-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 27 Dec 2013 16:17:22 -0000

On Fri, Dec 27, 2013 at 03:33:23PM +0100 I heard the voice of
Mathieu Arnold, and lo! it spake thus:
> 
> All you have to do is adapt it to run your particular setup,
> replacing da0 with the correct disk (and running it for each disk
> where your pool is, in my case, it was mfid0 and mfid1.)

I've taken to just dumping a rewrite-bootcode.sh script in /boot/ on
systems.  That way I don't have to remember or re-figure the
invocation, or worry about typos, or whatnot.  Makes it easy to just
kick the script after every installworld whether I really need it or
not, without having to think about it.

e.g.,

    % cat /boot/rewrite-bootcode.sh
    #!/bin/sh -x
    for i in /dev/ada0 /dev/ada1; do
            gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${i}
    done


-- 
Matthew Fuller     (MF4839)   |  fullermd@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1312270859430.32365>