From owner-freebsd-fs@FreeBSD.ORG Thu Aug 11 16:28:39 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDD79106564A for ; Thu, 11 Aug 2011 16:28:39 +0000 (UTC) (envelope-from cracauer@koef.zs64.net) Received: from koef.zs64.net (koef.zs64.net [IPv6:2001:470:1f0b:105e::1e6]) by mx1.freebsd.org (Postfix) with ESMTP id 6FCE08FC0C for ; Thu, 11 Aug 2011 16:28:39 +0000 (UTC) Received: from koef.zs64.net (koef.zs64.net [IPv6:2001:470:1f0b:105e::1e6]) by koef.zs64.net (8.14.5/8.14.4) with ESMTP id p7BGSc9K030971; Thu, 11 Aug 2011 18:28:38 +0200 (CEST) (envelope-from cracauer@koef.zs64.net) Received: (from cracauer@localhost) by koef.zs64.net (8.14.5/8.14.4/Submit) id p7BGScRe030970; Thu, 11 Aug 2011 12:28:38 -0400 (EDT) (envelope-from cracauer) Date: Thu, 11 Aug 2011 12:28:38 -0400 From: Martin Cracauer To: Adam Vande More Message-ID: <20110811162838.GA29108@cons.org> References: <20110811160314.GA25076@cons.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-fs@freebsd.org, Martin Cracauer Subject: Re: ZFS zpool mirror drive replacement confusion X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2011 16:28:40 -0000 Adam Vande More wrote on Thu, Aug 11, 2011 at 11:10:34AM -0500: > On Thu, Aug 11, 2011 at 11:03 AM, Martin Cracauer wrote: > > > NAME STATE READ WRITE CKSUM > > cbackup3 DEGRADED 0 0 0 > > mirror DEGRADED 0 0 0 > > ad6 ONLINE 0 0 0 > > ad10 REMOVED 0 0 0 > > ad2 ONLINE 0 0 11 > > > > Unfortunately I didn't keep note of the specific command that I used. > > > > Two questions: > > > > - Does somebody know offhand what I did and what I should have done > > instead to get ad2 into the mirror? > > > > What you did is add a disk to the zpool, not the mirror. `zpool history` shows: "zpool add -f cbackup3 ad2" What would have been correct? `zpool attach cbackup3 ad6 ad2` ? `zpool replace cbackup ad10 ad2` ? I guess they are equivalent except the first one would create a degraded three-way mirror. > > - Would there have been a way to remove ad2 from this set? > > > > I'm not sure of a way to remove the vdev other than to recreate from scratch > but perhaps the new features of zpool v28 allow for some forgiveness here. That reminds me to ask: Is there a way to clone a ZFS filesystem (not pool) including all snapshots inside? Let's say I have a 3-disk raidz filesystem with a bunch of snapshots and I want to go to new disks in a mirror setup. Is there a better way than doing an rsync snapshot by snapshot going forward? Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/