From owner-freebsd-fs@FreeBSD.ORG Thu Aug 11 17:55:37 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 19D7B106564A for ; Thu, 11 Aug 2011 17:55:37 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta08.westchester.pa.mail.comcast.net (qmta08.westchester.pa.mail.comcast.net [76.96.62.80]) by mx1.freebsd.org (Postfix) with ESMTP id B98928FC08 for ; Thu, 11 Aug 2011 17:55:36 +0000 (UTC) Received: from omta18.westchester.pa.mail.comcast.net ([76.96.62.90]) by qmta08.westchester.pa.mail.comcast.net with comcast id K4ER1h0021wpRvQ585vcRQ; Thu, 11 Aug 2011 17:55:36 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta18.westchester.pa.mail.comcast.net with comcast id K5va1h01M1t3BNj3e5vbSQ; Thu, 11 Aug 2011 17:55:36 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 839ED102C1A; Thu, 11 Aug 2011 10:55:33 -0700 (PDT) Date: Thu, 11 Aug 2011 10:55:33 -0700 From: Jeremy Chadwick To: Adam Vande More Message-ID: <20110811175533.GA3196@icarus.home.lan> References: <20110811160314.GA25076@cons.org> <20110811165140.GA1421@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 17:55:37 -0000 On Thu, Aug 11, 2011 at 12:24:38PM -0500, Adam Vande More wrote: > On Thu, Aug 11, 2011 at 11:51 AM, Jeremy Chadwick > wrote: > > > The problem is something I have run into myself many times. It's a > > syntax-specific "quirk" with the zpool command, and ONLY applies when > > working with mirrors. Furthermore, the "gotcha" may be gone with ZFSv28 > > (which you aren't running); I'm not sure. > > > > The "quirk" is that you have to specify the name of an existing > > (working) mirror device *before* the new device you're attempting to > > integrate. E.g. "zpool {command} pool {existingdev} {newdev}", rather > > than "zpool {command} pool {newdev}". Failure to provide the name of > > the device of the existing mirror member results in the pool becoming > > a stripe, which you have no way to recover from without recreating the > > entire pool. > > > > I would show you an example but all my systems run ZFSv28 and I can't > > seem to find any online documentation which helps back up my statement. > > I hope someone else here can phrase what I'm trying to say in a more > > eloquent manner and provide documentation/references confirming it. > > > > I think you mean this but I'm not sure I'd agree it's a quirk. If there is > an understanding of zpools, mirrors, and vdev's it seems like a logical > syntax. However, the unforgiving nature of vdev's does put some fear in me > whenever I make an change. > > http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide#Disk_Replacement_Example Yes, thank you -- that's one example of what I'm referring to. It applies to more than just "zpool replace" though; I'm pretty sure "zpool attach" is the one I'm thinking of: http://dbaspot.com/solaris/375684-zfs-convert-non-mirrored-mirrored.html Quoting the page: "zpool attach tank c1t2d0 c1t4d0" Had the individual done "zpool attach tank c1t4d0" they would have ended up with a stripe, which may or may not have been what they wanted. My personal preference is to refer to this as syntax/design flaw (someone wasn't thinking ahead), but I tend to piss people off when I get on my soapbox so I use the word "quirk" instead. The reason I classify it as such is that the chance of someone mucking up their pool as a result is extremely high. There are a *ton* of ways to address this in the parser. My choice would be to require a pool type designator in front of whatever you were doing (e.g. "zpool attach tank mirror c1t4d0", "zpool attach tank stripe c1t4d0", etc.). You get the idea. Sure, it's more characters to type, but it removes the ambiguity and greatly decreases the chance of someone screwing up. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |