zpool replace after device reordering

I'm curious how I'd go about solving this puzzle:

A raidz3 zpool with several vdevs had a drive go bad, and it was removed via:

Code:
 zpool offline tank da25

THEN, while the system was offline and the drive was replaced and before the zpool was brought back online we noticed the drive identification was off: what we thought was da4 was actually da5, etc. So we got that fixed in the usual way (via /boot/loader.conf hints) and brought the zpool back online.

At this point, the replacement drive is now da26, and the old da24 is now da25:

Code:
            da24                 ONLINE       0     0     0
            da25                 ONLINE       0     0     0
            6211956789331675853  OFFLINE      0     0     0  was /dev/da25
            da27                 ONLINE       0     0     0
            da28                 ONLINE       0     0     0

And when trying to replace the drive we get an error:

Code:
# zpool replace tank da26
cannot replace da26 with da26: no such device in pool

I believe this would be bad as it would replace the existing, good, in-use da25 with da26:

Code:
zpool replace tank da25 da26

I *think* this could be solved with a:

Code:
zpool export tank
zpool import tank

zpool replace tank da26

but I'd like confirmation or advice on this strategy.

Thanks!
 
Yeah, you need to use the identifier listed in the zpool output. da26 isn't listed, so you can't use that as the original disk to be replaced. Instead, you have to use the ZFS uuid of the disk, as shown in the post above.
 
Back
Top