According to the answer by Gilles
...There used to be a 2GB swap size limit (on most 32-bit platforms), but this has not been the case for years. The limitation was removed at some point in the 2.2 kernel series.
Additionally, he cites man page for mkswap
:
The maximum useful size of a swap area depends on the architecture and the kernel version.
In linux/swap.h library there is MAX_SWAPFILES
entry, so there is limit on the number of swap files on the kernel level, however that apparently isn't definitive area either. According to the linked document:
It should be noted that the six bits for “type” should allow up to 64 swap areas to exist in a 32 bit architecture instead of the MAX_SWAPFILES restriction of 32
Which I understand has having maximum of up to 64 swap files on the 32-bit architectures. However, I haven't noticed in the document mention what would happen on 64-bit architecture. Also worth noting that in this case, OP's efforts to create swap files failed on 30th entry.
As for swap partitions, there appears to be no limit for that in the kernel, besides previously mentioned constats, but number of any partitions still would be limited by the underlying BIOS and disk layout.