How to Disable and Delete a Swapfile?

Hello. I created a 16GB swap file according to the instructions here as my system kept on crashing with only 8GB of RAM. Now however, I’ve upgraded it to 24 GB, and I want to remove the swap file because I feel it’s too large. Could I know how I to go about this?

There is post that seems almost similar here, but the proferred solution within it does not apply to my situation.

sudo swapoff /swapfile
sudo rm /swapfile

then create a new one with the desired size and

sudo swapon /swapfile

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.