ZFS zpool mirror drive replacement confusion

Martin Cracauer cracauer at cons.org
Thu Aug 11 16:28:40 UTC 2011


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 <cracauer at cons.org> 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 <cracauer at cons.org>   http://www.cons.org/cracauer/


More information about the freebsd-fs mailing list