Setting the swap size in UI under System -> Advanced -> "Swap size in GB" works for disks with 512 sector size, but when using disks with 4k sector size it generates swap aprtitions that are 8x the size set.
When the default of 2GB is used there isn't a way to replace a disk of same size via GUI. Instead it fails with "Error: [EZFS_BADDEV] device is too small" because 16GB (8x the 2GB setting) is allocated to swap.
setting of 2GB generates 16GB swap partition. (see attached screenshots for workflow showing this issue with 2 drive of same size but diff sector size)
setting of 10GB generates 80GB swap partition.
Suggest reading "Sectorsize" from the disk before doing the math to calculate the number of sectors for the swap partition, or generate the partition based on size.