From owner-freebsd-fs@freebsd.org Sun Nov 22 23:05:26 2015 Return-Path: Delivered-To: freebsd-fs@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 3668CA3373B for ; Sun, 22 Nov 2015 23:05:26 +0000 (UTC) (envelope-from chris@stankevitz.com) Received: from mango.stankevitz.com (mango.stankevitz.com [208.79.93.194]) by mx1.freebsd.org (Postfix) with ESMTP id 2079A1102 for ; Sun, 22 Nov 2015 23:05:25 +0000 (UTC) (envelope-from chris@stankevitz.com) Received: from Chriss-MacBook-Pro.local (209-203-101-124.static.twtelecom.net [209.203.101.124]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mango.stankevitz.com (Postfix) with ESMTPSA id 88D3F41A01; Sun, 22 Nov 2015 15:05:24 -0800 (PST) Subject: Re: Recovering a zfs root pool from backup To: =?UTF-8?Q?Karli_Sj=c3=b6berg?= References: <8834bc1f-4e73-4315-a591-a4ff89dc80c9@email.android.com> Cc: FreeBSD Filesystems From: Chris Stankevitz Message-ID: <56524A34.8030806@stankevitz.com> Date: Sun, 22 Nov 2015 15:05:24 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <8834bc1f-4e73-4315-a591-a4ff89dc80c9@email.android.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2015 23:05:26 -0000 On 11/22/15 12:32 AM, Karli Sjöberg wrote: > > 1. I doubt I can create a new pool called "zroot" on Machine B since it > > is already running a pool called "zroot" > > > > 2. I doubt that this process will create the appropriate "boot sector" > > stuff (I do not know what I am talking about here). > > Exactly. You'd need to boot the machine from CD/USB to be able to > receive the stream. About the boot stuff. That would need to be handled > when partitioning the new drive: > # gpart create -t gpt (a)?da[0-9]+ > # gpart add -t freebsd-boot -s 64k -l boot0 (a)?da[0-9]+ > # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 (a)?da[0-9]+ > # gpart add -t freebsd-swap -b 2048 -s xg -l swap0 (a)?da[0-9]+ > # gpart add -t freebsd-zfs -a 4k -l sys0 (a)?da[0-9]+ > # sysctl vfs.zfs.min_auto_ashift=12 > > Also you need to set the "bootfs" property after the receive: > # zpool set bootfs=zroot zroot Karli, Thank you. Should I be concerned that I cannot "zpool create zroot" from my recovery setup because there will already be a pool with that name? If so, how should I get around that? I know I can give it a temporarily different name and later export/import to rename it -- but it's not clear to me that I will ever get that renamed given that I will always be running FreeBSD with a zroot. Perhaps I could give it a different name "zroot2" (and "zpool set bootfs=zroot2 zroot2")... boot to that... then rename it back to zroot and reboot to complete the restore. Thank you again, Chris