Modify swap size in a ZFS disk

  1. Remove the existing swap
    swap -d /dev/zvol/dsk/rpool/swap
  2. Create the swap with the required size
    zfs set volsize=16G rpool/swap
  3. Reserve the space to make sure the space is not used for anything else
    zfs set refreservation=16G rpool/swap
  4. Activate the swap
    swap -a /dev/zvol/dsk/rpool/swap