From owner-freebsd-current@FreeBSD.ORG Tue Jan 21 09:36:36 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4353E4E1 for ; Tue, 21 Jan 2014 09:36:36 +0000 (UTC) Received: from forward10l.mail.yandex.net (forward10l.mail.yandex.net [84.201.143.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBA7E1866 for ; Tue, 21 Jan 2014 09:36:35 +0000 (UTC) Received: from smtp18.mail.yandex.net (smtp18.mail.yandex.net [95.108.252.18]) by forward10l.mail.yandex.net (Yandex) with ESMTP id 2EECDBA1020; Tue, 21 Jan 2014 13:36:28 +0400 (MSK) Received: from smtp18.mail.yandex.net (localhost [127.0.0.1]) by smtp18.mail.yandex.net (Yandex) with ESMTP id D3FDC18A062A; Tue, 21 Jan 2014 13:36:27 +0400 (MSK) Received: from 84.201.164.23-vpn.dhcp.yndx.net (84.201.164.23-vpn.dhcp.yndx.net [84.201.164.23]) by smtp18.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 9DdY01E5gE-aRfCh15s; Tue, 21 Jan 2014 13:36:27 +0400 (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (Client certificate not present) X-Yandex-Uniq: 44118f56-7ba3-499e-a70e-de528c98fa1c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1390296987; bh=tqZnaXV5tHfPpHSc7SYTaPzYBhlXHV87Hlp+3VMkyZY=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:X-Enigmail-Version:Content-Type: Content-Transfer-Encoding; b=T4xcTvUa5h4KD+fED6p+Uk1LeDidF2iq68rnSkgoWdt2ZjqffgteL5FnFBZ48DPjb 12FTCjZJlCOKmfzHNuWMSPB2qWbRY3RnARyATsGr2HjmTqa3nCGa6ytR393tVpa0Yv jNxDWGMBtKPCQcgOvxiuSmsKAKm21yt4ajz6jjaU= Authentication-Results: smtp18.mail.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <52DE3F6B.6050209@yandex.ru> Date: Tue, 21 Jan 2014 13:35:39 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Thomas Hoffmann , freebsd-current Subject: Re: Problem updating bootcode on ZFS on root system with MBR References: In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jan 2014 09:36:36 -0000 On 20.01.2014 23:32, Thomas Hoffmann wrote: > I am running 11.0-CURRENT (r260850) with zfs on root with MBR. > > After upgrading my 10.0-RELEASE (r260669) system to 11.0-CURRENT (r260850) > my zpools reported that they needed to be upgraded. So, I upgraded my > zpools and I am attempting to update the bootcode (as required). I managed > to get the boot1 stage code updated, but cannot get the boot2 stage code > updated. Here is what I have done: > > # sysctl kern.geom.debugflags=0x10 > kern.geom.debugflags: 0 -> 16 > > # dd if=/boot/zfsboot of=/tmp/zfsboot1 count=1 > 1+0 records in > 1+0 records out > 512 bytes transferred in 0.014996 secs (34142 bytes/sec) > > # gpart bootcode -b /tmp/zfsboot1 /dev/ada0s1 > bootcode written to ada0s1 > > # dd if=/boot/zfsboot of=/dev/ada0s1a skip=1 seek=1024 > dd: /dev/ada0s1a: Operation not permitted > > The final dd statement fails with "operation not permitted". In all my > research, understood the initial sysctl command I ran would prevent this > particular error from happening. > > What do I need to do to get the boot2 code written to /dev/ada0s1a? This will work only if ada0s1a isn't in use. The debugflags trick works only for whole disk, i.e. for geoms with rank=1. Another way is calculate needed offset and write bootcode directly to ada0. -- WBR, Andrey V. Elsukov