zfs
zfs copied to clipboard
Misleading error message when trying to replace device in zpool, if ashift doesn't match
Was #12382, but that issue is old and closed, so I am creating a new one.
Other cases of the same problem: https://forum.proxmox.com/threads/zpool-disk-replacement-already-in-replacing-spare-config-wait-for-completion-or-use-zpool-detach.96554/
The cause seems to be, the detected ashift for the incoming device doesn't match the existing ashift of the vdev. But the reported error is:
cannot replace X with Y: already in replacing/spare config; wait for completion or use 'zpool detach'
When there is no resilver in progress.
in libzfs_pool.c, zpool_vdev_attach; probably a case is missed when ENOTSUP is returned.