How to Permanently Disable Swap in Linux

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

4 Responses

  1. S. Daniels says:

    These instructions are rather outdated for any linux with a desktop:MATE, xfce, Gnome or KDE/Plasma. Firstly, the program Gparted very nicely displays swap size, location and UUID. “blkid”, especially on a dual-boot or system with multiple OSes is just going to display a lot of confusing and unhelpful entries.

    The KDE partitioner is inferior, but adequate. The centos-swap is fairly specific to CentOS Linux, this should be explained in the article. A swap file can also be used in place of a dedicated partition, this should also be mentioned.

    “Vi” is very much overkill for editing fstab. “Vim” is easier than “vi” for newbies in every case, and “pico /etc/fstab” or “nano /etc/fstab” are more appropriate here.

    Finally, for José , 30GB is seriously wrong. I suspect he somehow changed a data or system partition into a swap partition. He can “manage flags in Gparted” to inspect it for contents.

    I’m just a hobbyist, but have nearly 20 years experience, since a Debian bootable CD, the first Linux installation disk that did not need a floppy to boot, came out in 2000.

  2. Matei Cezar says:

    You can shrink the swap partition to a smaller size. 30G of swap is kind of large file or partition for swapping.

  3. Kunal Ghosh says:

    If there is sufficient RAM (8GB), computer may never access swap space. What is the benefit of disabling swap in this case? Conversely, how will swap cause problems if the computer never accesses it.

  4. José Luis Rosales says:

    In my case, I have 30 GB. free 0 GB. I should not disable?

    total used free shared buff/cache available
    Memoria: 7.7G 1.6G 4.6G 196M 1.5G 5.6G
    Swap—–: 30G 0B 30G

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.