PDA

View Full Version : [SOLVED] How to absolutely turn off 'swap'?



andycivil
November 2nd, 2012, 11:49 PM
How can I absolutely turn swap off? Setting 'swappiness' to zero doesn't actually prevent it. I want it so that when I run "top" it actually says "Swap: 0k Total...".

Forgive me if I don't explain why, but I think it might invite argument.

It's looking like the "swapoff -a" command is what I need, but I don't know where to put it, and it would be better to not enable it rather than having it and then disabling it.

darkod
November 2nd, 2012, 11:52 PM
Open /etc/fstab for editing with:
gksu gedit /etc/fstab

and simply add # at the start of the line mounting swap. That will comment out (disable) that line. In the future if you want to enable it, remove the #.

Save and close the file. Reboot.

andycivil
November 3rd, 2012, 01:57 AM
Worked perfectly, thank you.