On Mon, Dec 7, 2009 at 12:42 PM, Cindy Swearingen <cindy.swearin...@sun.com> wrote: > 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?
When adding a disk to a single-disk pool, this message isn't given and the add proceeds without any warning and without the need to force it: # cd /tmp # mkfile 256m f1 f2 # zpool create testpool /tmp/f1 # zpool add testpool /tmp/f2 # zpool status testpool pool: testpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM testpool ONLINE 0 0 0 /tmp/f1 ONLINE 0 0 0 /tmp/f2 ONLINE 0 0 0 errors: No known data errors Would it be beneficial to have a command line option to zpool that would only "preview" or do a "dry-run" through the changes, but instead just display what the pool would look like after the operation and leave the pool unchanged? For those that very rarely make pool changes, getting in the habit of always using an option like this might be a good way to ensure the change is really what is desired. Some information that might be nice to see would be the before and after versions of "zpool list", the "zpool status", and what command could be run to reverse the change, or a warning if the change is irreversible like the case with "zpool add". Ed Plese _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss