[EZFS_BADDEV] cannot replace disk: device is too small. And the new partition size is wrong

I’m unable to replace a failed disk in a mirror zfs with TrueNAS 25.10.1 Goldeye. The pool was created on an older FreeBSD version of FreeNAS.

The new disk (sdb) has the same size of the existing one (sdd), same model, same manufacturer.

I wiped the new disk sdb and then rebooted, the partition table of sdb is empty at boot:

root@truenasbk[~]# fdisk -l /dev/sdb
Disk /dev/sdb: 5.46 TiB, 6001175126016 bytes, 11721045168 sectors
Disk model: ST6000VN001-2BB1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
root@truenasbk[~]#

And this is the partition table of the working disk is:

root@truenasbk[~]# fdisk -l /dev/sdd
Disk /dev/sdd: 5.46 TiB, 6001175126016 bytes, 11721045168 sectors
Disk model: ST6000VN001-2BB1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C94D45C5-B791-11EE-AE0A-3CA82A9FE12C
Device Start End Sectors Size Type
/dev/sdd1 128 4194431 4194304 2G FreeBSD swap
/dev/sdd2 4194432 11721045127 11716850696 5.5T FreeBSD ZFS

I have three zfs pools on the system:

root@truenasbk[~]# zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
boot-pool 28.5G 10.1G 18.4G - - 13% 35% 1.00x ONLINE -
vol-hd 5.45T 2.57T 2.88T - - 6% 47% 1.00x DEGRADED /mnt
vol-ssd 928G 2.08G 926G - - 2% 0% 1.00x ONLINE /mnt

From the web GUI, Storage → in vol-hd choose “View VDEVs”, I select the offline disk, then click on the Replace button. I then choose the new empty disk, I confirm and it fails with the error:

[EZFS_BADDEV] cannot replace 3661435474739937380 with /dev/disk/by-partuuid/26093ced-3f44-43e3-acb4-adc63477fa22: device is too small

After a bit of investigation, the failure can be caused by the size of the new partition of the new disk: a wrong size partition is created on the new disk. The new partition size is taken from the wrong pool (vol-ssd instead of vol-hd)

root@truenasbk[~]# fdisk -l /dev/sdb
Disk /dev/sdb: 5.46 TiB, 6001175126016 bytes, 11721045168 sectors
Disk model: ST6000VN001-2BB1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6141CF0A-33F9-430B-BB76-51B500F82FF2

Device Start End Sectors Size Type
/dev/sdb1 2048 1949332743 1949330696 929.5G Solaris /usr & Apple ZFS

Any suggestions ?

Thank you