![]() | 1 | initial version |
As noted in the answer from @aeperezt, you can use swapoff -a
to disable swap and swapon -a
to enable it again - use swapon -s
to see a summary of swap file usage and priority etc.
If you want to permanently remove swap space from your system:
sudo -i
Use your password.swapoff -a
cp /etc/fstab{,.orig}
/etc/fstab
file to remove the swap file entry (use an editor you are comfortable with, for example vi
or nano
). It will look something like:/dev/mapper/HOST-swap swap swap defaults 0 0
The first entry on the line may point to a device file (/dev/VALUE
) or possibly a UUID=some-random-long-string
-- just look for the swap entries and delete the entire line./etc/fstab
file is valid by issuing:
mount -a
swapon -s # to verify swap is not active
If it reports a problem, then fix the problem in the fstab file before continuing (remember you have your backup from step 3).