ZFS zpool mirror drive replacement confusion

Jeremy Chadwick freebsd at jdc.parodius.com
Thu Aug 11 17:55:37 UTC 2011


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
> <freebsd at jdc.parodius.com>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 |



More information about the freebsd-fs mailing list