How Do I Decrease the Size of a Preexisting Swap File Without Removing it?

Solution 1:

how do I decrease the size of the swap file without removing it?

This question is rather irrelevant. Swap space must be taken out of use before changing it. The command sudo fallocate -l 4G /swapfile (with an adjusted size) will overwrite your existing swapfile if you do not delete it first.