I agree that zpool attach and add look similar in their syntax,
but if you attempt to "add" a disk to a redundant config, you'll
see an error message similar to the following:

# zpool status export
  pool: export
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        export      ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            c1t3d0  ONLINE       0     0     0
            c1t4d0  ONLINE       0     0     0

errors: No known data errors
# zpool add export c1t6d0
invalid vdev specification
use '-f' to override the following errors:
mismatched replication level: pool uses mirror and new vdev is disk

Doesn't the "mismatched replication" message help?

Cindy

On 12/06/09 14:13, Andriy Gapon wrote:
on 06/12/2009 19:40 Volker A. Brandt said the following:
I wanted to add a disk to the tank pool to create a mirror. I accidentally
used zpool add ? instead of zpool attach ? and now the disk is added. Is
there a way to remove the disk without loosing data?
Been there, done that -- at a customer site while showing off
ZFS. :-)

Currently, you cannot remove a "simple" device.  Depending
on your Solaris version, you can remove things like hot spares and
cache devices, but not simple vdevs.

Backup the pool and recreate it in the correct way.


Sorry for the bad news -- Volker

Yep.  My 2 cents -- 'add' and 'attach' are so similar the words that I think
that ZFS tools UI designers (if any) should re-consider naming of these
commands.  Or 'add' command should always be interactive and ask for at least
two confirmations that a user knows what he is doing and why.  Perhaps, it
should include a ZFS micro-exam too.
Jokes aside, this is too easy to make a mistake with the consequences that are
too hard to correct.  Anyone disagrees?

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to