From owner-freebsd-current@FreeBSD.ORG Thu Oct 11 20:34:21 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B16C16A468 for ; Thu, 11 Oct 2007 20:34:21 +0000 (UTC) (envelope-from rse@engelschall.com) Received: from visp1.engelschall.com (visp1.engelschall.com [195.30.6.144]) by mx1.freebsd.org (Postfix) with ESMTP id B195B13C494 for ; Thu, 11 Oct 2007 20:34:20 +0000 (UTC) (envelope-from rse@engelschall.com) Received: by visp1.engelschall.com (Postfix, from userid 21100) id 343901B4482D; Thu, 11 Oct 2007 22:34:17 +0200 (CEST) Received: by en1.engelschall.com (Postfix, from userid 10000) id C4B006DC8B; Thu, 11 Oct 2007 22:32:29 +0200 (CEST) Date: Thu, 11 Oct 2007 22:32:29 +0200 From: "Ralf S. Engelschall" To: freebsd-current@freebsd.org Message-ID: <20071011203229.GA39924@engelschall.com> References: <20071011184340.GA13972@engelschall.com> <20071011190441.GA40950@heff.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071011190441.GA40950@heff.fud.org.nz> Organization: FreeBSD User-Agent: Mutt/1.5.16 OpenPKG/CURRENT (2007-06-09) Subject: Re: reanimate ZFS pool after disk cloning and host changing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Ralf S. Engelschall" List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2007 20:34:21 -0000 On Fri, Oct 12, 2007, Andrew Thompson wrote: > On Thu, Oct 11, 2007 at 08:43:40PM +0200, Ralf S. Engelschall wrote: > > I've a FreeBSD 7-CURRENT (as of 2007-10-09) running in a VirtualBox > > virtual machine and with all filesystems except /boot on ZFS. Now that > > we switched to 7.0-PRERELEASE and 8-CURRENT I today created another > > virtual machine and just cloned the disks (with "vboxmanage clonevdi", > > but it doesn't matter here). > > > > When I then booted the new virtual machine with the cloned disks, the > > root filesystem couldn't be mounted during boot via "zfs:zp1/root" as > > the ZFS pool "zp1" is no longer available. > > > > So I booted into the Fixit environment from > > "7.0-CURRENT-200709-i386-disc1.iso" and tried "zpool import". It was > > able to detect the pool on device ad0s1f. The problem just is that the > > hostid has changed (which is correct), so I thought I just have to > > re-import the ZFS pool with "zfs import -R /zp1 -f zp1". This still > > worked just fine: all filesystem were available under temporary /zp1 > > now (I had to use this alternative root or the Fixit environment is > > immediately dead). But once I then reboot into the system, the ZFS pool > > is again not found via "zfs:zp1/root"! > > > > In tried multiple times with various ways in the Fixit environment: > > "zfs import zp1" is denied because the hostid is different, "zfs import > > -f zp1" does the trick (although breaks the Fixit environent) but > > after reboot the ZFS pool again gone, "zfs import -R /zp1 -f zp1" does > > also the trick but here again the ZFS pool is gone after reboot. > > > > So, the silly question is: what is the correct way to reanimate a ZFS > > pool after the host has changed, so that one can again directly boot > > from from one of its filesystems (here "zp1/root")? > > Is /boot/zfs/zpool.cache up to date after importing the pool? If your > seperate /boot filesystem isnt mounted when you import then you will > need to overwrite it manually. Ah, an important point which I totally overlooked. In the Fixit environment /boot is not writable, of course. I retried by mounting the UFS /boot manually inside the Fixit environment before doing the "zfs import". This finally did the trick! Thanks for your quick reply and the essential hint. -- rse@FreeBSD.org Ralf S. Engelschall FreeBSD.org/~rse rse@engelschall.com FreeBSD committer www.engelschall.com