From owner-freebsd-questions@FreeBSD.ORG Wed Dec 19 14:22:26 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6323B52D for ; Wed, 19 Dec 2012 14:22:26 +0000 (UTC) (envelope-from dweimer@dweimer.net) Received: from webmail.dweimer.net (24-240-198-187.static.stls.mo.charter.com [24.240.198.187]) by mx1.freebsd.org (Postfix) with ESMTP id 15C7E8FC0C for ; Wed, 19 Dec 2012 14:22:25 +0000 (UTC) Received: from www.dweimer.net (webmail.dweimer.local [192.168.5.1]) by webmail.dweimer.net (8.14.5/8.14.5) with ESMTP id qBJEMFUv085462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 19 Dec 2012 08:22:15 -0600 (CST) (envelope-from dweimer@dweimer.net) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 19 Dec 2012 08:22:15 -0600 From: dweimer To: "Christopher J. Ruwe" Subject: Re: Curious question about using zfs send -R and receive on FreeBSD Organization: dweimer.net Mail-Reply-To: In-Reply-To: <20121219140137.4673f395@dijkstra> References: <2930c477429212255788f1a2c90aa202@dweimer.net> <20121219140137.4673f395@dijkstra> Message-ID: X-Sender: dweimer@dweimer.net User-Agent: Roundcube Webmail/0.8.1 Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dweimer@dweimer.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 14:22:26 -0000 On 2012-12-19 07:01, Christopher J. Ruwe wrote: > On Mon, 17 Dec 2012 16:00:06 -0600 > dweimer wrote: > >> I recently migrated a machine that was built on a VM to physical >> hardware using the zfs send -R option against a snapshot of its root >> zfs setup. I went from smaller drives to larger, both using a >> mirrored zpool. However the devices were different, the device IDs >> on the VM were da0 and da1, the device IDs on the physical hardware >> were ada0 and ada1. I had used labels when creating the gpt layout >> to plan for this. And all worked great, in fact it was the fastest I >> have ever converted a virtual machine to a physical machine. >> After I finished though, I got curious, was it actually necessary >> for me to mount the new boot zfs partition while running on the live >> cd and copy the zpool.cache file I had created when creating the >> zpool or would have the existing cache file that would have been >> included in the zfs send contained the right information? As the >> zpool was pointed at the gpt label devices, or was the fact that the >> size changed enough difference that copying the file was indeed >> necessary? >> > > I fear you might be mixing things up here. You did a zfs-migrate, not > a > zpool-migrate, you created a new zpool and received the datasets on > that > new zpool, even if the zpool names were the same. > > The function of zpool.cache is to tell the OS about available > device-zpool combinations. Without, the OS does not know which zpools > are available and accordingly cannot mount the root-ZFS passed in the > vfs.root.mountfrom directive in loader.conf, which is why you needed > to > copy the zpool.cache and, if you changed the zpool-names, needed to > adapt loader.conf. > > There are plans to change this behaviour, as it is deemed superfluous > at > least in the case of disks, but I do not know how much that has > progressed so far. > > > http://lists.freebsd.org/pipermail/freebsd-fs/2012-October/015328.html > > > Hope I could shed some light on that issue, although I am by no means > an > expert on this. > > Cheers, Yes that did explain it, and I did keep the zpool the same name to avoid having to change the loader.conf. This also does answer other things as well for me. In that this should be able to be done from a mirror to a zraid, or single disk pool. But as you have pointed out the migration is done on the ZFS data layer that is on top of the zpool layer, so it shouldn't matter what the underlying zpool raid level is. And likewise wouldn't matter if the hardware devices behind it changed even if I hadn't used gpt labels to configure the zpool. Good information to know going forward, thanks for the explanation. -- Thanks, Dean E. Weimer http://www.dweimer.net/