From owner-freebsd-questions@FreeBSD.ORG Tue May 27 08:32:42 2014 Return-Path: Delivered-To: freebsd-questions@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 CFE3B53E for ; Tue, 27 May 2014 08:32:42 +0000 (UTC) Received: from blue.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) (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 68FCA2D8E for ; Tue, 27 May 2014 08:32:42 +0000 (UTC) Received: from fileserver.home.qeng-ho.org (localhost [127.0.0.1]) by fileserver.home.qeng-ho.org (8.14.7/8.14.5) with ESMTP id s4R8WR5d026206; Tue, 27 May 2014 09:32:28 +0100 (BST) (envelope-from freebsd@qeng-ho.org) Message-ID: <53844D9B.4090902@qeng-ho.org> Date: Tue, 27 May 2014 09:32:27 +0100 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Janos Dohanics , FreeBSD Questions Subject: Re: gpart backup, restore and bootcode References: <20140527035956.c55adc6dd0ed34da2ac4f843@3dresearch.com> In-Reply-To: <20140527035956.c55adc6dd0ed34da2ac4f843@3dresearch.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 May 2014 08:32:42 -0000 On 27/05/2014 08:59, Janos Dohanics wrote: > Hello list members, > > Do the commands gpart backup and gpart restore also back up and restore > the bootcode? The gpart(8) man page says: > > "restore Restore the partition table from a backup previously created > by the backup action and read from standard input. Only the > par- tition table is restored. This action does not affect > the con- tent of partitions. After restoring the partition > table and writing bootcode if needed, user data must be > restored from backup." > > I read this section as "yes" - is this correct? I assume "yes" since my > bootcode is embedded having been added using "gpart bootcode -b ..." > and thus "embed-ded in the partitioning scheme's metadata". > > Is there a way to show/verify if bootcode is written to the disk? > If you actually try "gpart backup" you get something like arthur@fileserver[0]> gpart backup ada0 GPT 128 1 freebsd-boot 40 128 2 freebsd-ufs 168 2097152 fs-root [bootme] 3 freebsd-swap 2097320 16777216 fs-swap 4 freebsd-ufs 18874536 2097152 fs-usr 5 freebsd-ufs 20971688 2097152 fs-spare1 6 freebsd-ufs 23068840 4194304 fs-tmp 7 freebsd-ufs 27263144 2097152 fs-spare2 8 freebsd-ufs 29360296 10485760 fs-usr-obj 9 freebsd-ufs 39846056 20971520 fs-var 10 freebsd-ufs 60817576 20971520 fs-usr-local 11 freebsd-ufs 81789096 4194304 fs-usr-src which is pretty much a variant of "gpart show" on the same disk plus a line saying how big the GPT is. No sign of a PMBR bootstrap in that.