I had to refresh Solaris on one of our old servers. After clean install on the first drive c1t0d0 with ZFS filesystem, I had to create root pool mirror by second drive c1t1d0 using zpool attach:

# zpool attach rpool c1t0d0s0 c1t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c1t1d0s0 contains a ufs filesystem.

As c1t1d0 had a ufs filesystem from previous installation, I tried to force:

# zpool attach -f rpool c1t0d0s0 c1t1d0s0
cannot attach c1t1d0s0 to c1t0d0s0: device is too small

I realized that an old disk slice c1t1d0s0 can be smaller than c1t0d0s0 as c1t0d0s0 was reinitialized by installer and expanded to whole disk. I could check it using prtvtoc:

# prtvtoc /dev/dsk/c1t0d0s2
* /dev/dsk/c1t0d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 848 sectors/track
* 24 tracks/cylinder
* 20352 sectors/cylinder
* 14089 cylinders
* 14087 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 286698624 286698623
2 5 00 0 286698624 286698623
#

I decided to save this map into a file and write to my second drive using fmthard then:

# prtvtoc /dev/dsk/c1t0d0s2 > /tmp/vtoc_root.out
# fmthard -s /tmp/vtoc_root.out /dev/rdsk/c1t1d0s2
fmthard: New volume table of contents now in place.

Now zpool attach works much better:

# zpool attach rpool c1t0d0s0 c1t1d0s0
Please be sure to invoke installboot(1M) to make 'c1t1d0s0' bootable.
Make sure to wait until resilver is done before rebooting.

# zpool status rpool
pool: rpool
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h0m, 37.79% done, 0h1m to go
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
c1t0d0s0 ONLINE 0 0 0
c1t1d0s0 ONLINE 0 0 0 2.44G resilvered
errors: No known data errors

Last but not least step was to make c1t1d0s0 bootable using installboot:

# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c1t1d0s0