17.2.4 Removing a Swap File or Swap Partition

To remove a swap file or swap partition from use:

  1. Disable swapping to the swap file or swap partition, for example:

    # swapoff /swapfile
  2. Remove the entry for the swap file or swap partition from /etc/fstab.

  3. Optionally, remove the swap file or swap partition if you do not want to use it in future.