It’s doable with a swap file instead. But some filesystems are more supportive than others.
For example BTRFS doesn’t support swapfiles over multiple devices (so my raid1c3 spanning 3 differently sized disks for example) and also swapfiles must be completely pre-allocated.
And no matter the filesystem you need to manually tell the kernel device and physical offset for the file via kernel parameters. Which can again be easier on some than on others (also causing the no-multiple-device filesystem problem mentioned above.
It’s doable with a swap file instead. But some filesystems are more supportive than others.
For example BTRFS doesn’t support swapfiles over multiple devices (so my raid1c3 spanning 3 differently sized disks for example) and also swapfiles must be completely pre-allocated.
And no matter the filesystem you need to manually tell the kernel device and physical offset for the file via kernel parameters. Which can again be easier on some than on others (also causing the no-multiple-device filesystem problem mentioned above.