Adding another disk to a ZFS mirror

I was asked how to add a disk into a ZFS mirror today; this is an easy one:


# zpool attach [poolname] [existing disk] [new disk]


…and done! The pool will begin to resilver with the new disk as part of the existing mirror. You might want to do this to replace a part of the mirror which has been removed or is faulty, or you might want to expand a 2-way mirror to a 3-way mirror (longer MTBF for  the 3-way, beyond that it’s not worth it).