From owner-freebsd-questions@freebsd.org Wed Feb 15 08:34:37 2017 Return-Path: Delivered-To: freebsd-questions@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 116E2CE0DD8 for ; Wed, 15 Feb 2017 08:34:37 +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 02C118DB for ; Wed, 15 Feb 2017 08:34:36 +0000 (UTC) (envelope-from chris@stankevitz.com) Received: from stink.local (209-203-101-124.static.twtelecom.net [209.203.101.124]) by mango.stankevitz.com (Postfix) with ESMTPSA id DE1693C673 for ; Wed, 15 Feb 2017 00:34:35 -0800 (PST) Subject: Re: Stale zpool from a prior life in "zpool import" To: FreeBSD Questions References: <3aff436c-4e15-ec41-5b54-532cc036fdc0@toyon.com> From: Chris Stankevitz Message-ID: Date: Wed, 15 Feb 2017 00:34:34 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 08:34:37 -0000 On 2/14/17 10:05 PM, Chris Stankevitz wrote: > On 2/14/17 12:45 PM, Chris Stankevitz wrote: >> How do I remove the UNAVAIL zpool? > > Here's how I solved this: > > 1. use "zdb -l /device" on my devices to figure out which ones held > references to these ghost zpools. I had to call this on my raw disks, > the partitions, and the decrypted .eli devices to catch them all > > 2. for each of the devices discovered with ghost zpool data, I ran > "zpool labelclear -f /device". Unfortunately this destroyed the geli > metadata. grrr. > > 3. I was careful about the order in which I called labelclear so that if > devices were destroyed (which they were) a resilver would have brought > my pool back. However, the geli folks backed up the metadata to > /var/backups during init. I used "geli restore /var/backups/foo.eli > /dev/gpt/foo" on the affected partitions to restore the encrypted > partitions. I wonder what else "zpool labelclear" could have destroyed > (gpt???). 4. I also had to follow this up with a gpart recover Chris