From owner-freebsd-stable@FreeBSD.ORG Thu Nov 26 11:09:26 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7BD91065676 for ; Thu, 26 Nov 2009 11:09:26 +0000 (UTC) (envelope-from arnaud.houdelette@tzim.net) Received: from golanth.tzim.net (unknown [IPv6:2001:41d0:1:d91f:21c:c0ff:fe4b:cf32]) by mx1.freebsd.org (Postfix) with ESMTP id 64F378FC1E for ; Thu, 26 Nov 2009 11:09:26 +0000 (UTC) Received: from 12rf.tzim.net ([82.232.60.244] helo=[192.168.0.10]) by golanth.tzim.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.70 (FreeBSD)) (envelope-from ) id 1NDcE1-00039H-Go; Thu, 26 Nov 2009 12:09:25 +0100 Message-ID: <4B0E61E2.7070509@tzim.net> Date: Thu, 26 Nov 2009 12:09:22 +0100 From: Arnaud Houdelette User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Scot Hetzel References: <4B0E3ABA.3030606@tzim.net> <790a9fff0911260040i1456d7c0j4f8327d24d2966cf@mail.gmail.com> <4B0E43B1.6050802@tzim.net> <790a9fff0911260200kf07d6d2nf7cf9eb9d2c07bcf@mail.gmail.com> In-Reply-To: <790a9fff0911260200kf07d6d2nf7cf9eb9d2c07bcf@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-User: tzim@tzim.net X-Authenticator: plain Cc: freebsd-stable@freebsd.org Subject: Re: Can't use gpt labels re-importing pool X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 11:09:27 -0000 Scot Hetzel wrote: > On 11/26/09, Arnaud Houdelette wrote: > >> Scot Hetzel wrote: >> >> >>> On 11/26/09, Arnaud Houdelette wrote: >>> >>> >>> >>>> I just upgraded from 7.2 to 8.0. >>>> Under 7.2 the pool was like : >>>> NAME STATE READ WRITE CKSUM >>>> tank ONLINE 0 0 0 >>>> raidz1 ONLINE 0 0 0 >>>> ad6p1 ONLINE 0 0 0 >>>> ad10p1 ONLINE 0 0 0 >>>> ad8p1 ONLINE 0 0 0 >>>> ad4p1 ONLINE 0 0 0 >>>> >>>> I'd like to use gpt labels or gptids reimporting the pool. >>>> # ls /dev/gpt >>>> disk1 disk2 disk3 disk4 >>>> # ls /dev/gptid >>>> 0902db4e-d462-11de-96bd-001d923bc7a0 >>>> 9fb111f8-d426-11de-99bc-001d923bc7a0 >>>> 1be29091-d9dc-11de-9f4a-001d923bc7a0 >>>> ffb4e96a-d497-11de-96bd-001d923bc7a0 >>>> >>>> I did # zpool import -d /dev/gpt tank >>>> and I got >>>> tank ONLINE >>>> raidz1 ONLINE >>>> ada1p1 ONLINE >>>> ada3p1 ONLINE >>>> ada2p1 ONLINE >>>> gpt/disk4 ONLINE >>>> >>>> Now, how to force zpool import to only use gpt labels (or uuids) ? Or >>>> >> at >> >>>> least get back to coherent situation ( zpool export tank / zpool import >>>> gives the same now. and zpool import -d /dev, as zpool import -d >>>> >> /dev/gptid >> >>>> gives nothing ) ? >>>> >>>> >>>> >>>> >>> Use 'zpool replace' to change the zfs pool to use the gpt names: >>> >>> zpool replace tank ada1p1 gpt/disk1 >>> zpool replace tank ada2p1 gpt/disk2 >>> zpool replace tank ada3p1 gpt/disk3 >>> >>> NOTE: make sure you use the correct gpt names for each partition, as >>> the above assumes that ada1p1 is labeled as disk1. >>> >>> Scot >>> >>> >>> >> Mmmh, zpool replace will resilver the drive, won't it ? >> > > Yes, it will resilver the drive, but it shouldn't take as long as it > will recognize that it is the same drive. Just wait for the resilver > process to finish before changing the next drive. > > >> Moreover, I can't use replace as when adaXp1 is used, the corresponding >> /dev/gpt entry disapears. Unless you mean that I can use replace before >> import ? >> >> > > There was a discussion about this back in July: > > http://lists.freebsd.org/pipermail/freebsd-current/2009-July/009440.html > > In that discussion, they had used glabel to label each drive, and then > use zpool replace on the active pool to change it to use the label. > > Just make sure that you use the gpt name that you assigned to ada1p1, > when replacing it. > > Scot > That does not work or there's something I'm doing wrong. # uname -a FreeBSD carenath.tzim.net 8.0-RELEASE FreeBSD 8.0-RELEASE #26: Wed Nov 25 23:43:22 CET 2009 tzim@carenath.tzim.net:/usr/obj/usr/src/sys/CARENATH amd64 As I said, the label is not present in /dev/gpt while used with adaXp1 ( here ada1p1 has label HD753LJ-1) : # ls /dev/gpt HD753LJ-4 zfs-boot # zpool replace tank ada1p1 gpt/HD753LJ-1 cannot open 'gpt/HD753LJ-1': no such GEOM provider If I offline the drive first, I get another error : # zpool offline tank ada1p1 # zpool replace tank ada1p1 gpt/HD753LJ-1 invalid vdev specification use '-f' to override the following errors: /dev/gpt/HD753LJ-1 is part of active pool 'tank' # zpool replace -f tank ada1p1 gpt/HD753LJ-1 invalid vdev specification the following errors must be manually repaired: /dev/gpt/HD753LJ-1 is part of active pool 'tank' I know there is the solution of cleaning the disk and resilvering, but if I could avoid this ? Arnaud