Removing a Swap File or Swap Partition
To remove a swap file or swap partition from use:
-
Disable swapping to the swap file or swap partition, for example:
sudo swapoff /swapfile
-
Remove the entry for the swap file or swap partition from
/etc/fstab
. -
Optionally, remove the swap file or swap partition if you no longer need it.