How to disable swap permanently

chpicolo
  6 years ago
  1

Sometimes you have enough RAM and want to preserve a Linux running from a SD card (that have a limit of use), so disabling swap can make the SD card life last longer.
So you can disable it by logging as "root" or "sudo su" from Terminal then enter the following:

dphys-swapfile swapoff
dphys-swapfile uninstall
update-rc.d dphys-swapfile remove