5 Replies Latest reply on Apr 5, 2021 11:43 AM by dragonfly.67

    How do I permanently disable the swap service?

      My Device: Raspberry PiRaspberry Pi


      Situation: Automatic Force-Restoration of Swap service

      For some unknown reason, Raspbian OS permanently reloads the swap service at every reboot. Here are the steps I have to do after every reboot:

      1. sudo sync
      2. sudo swapoff -a
      3. sudo apt-get purge -y dphys-swapfile
      4. sudo rm /var/swap
      5. sudo sync

      This stop swap, but it's back on a reboot. Writing this list into a script makes the script vanish upon a reboot with swap service activated.

      Here are the other attempts I've tried and tried to kill the swap service:

      • sudo update-rc.d dphys-swapfile disable
      • sudo rm /etc/init.d/dphys-swapfile
      • sudo dphys-swapfile disable
      • sudo dphys-swapfile swapoff
      • sudo dphys-swapfile uninstall
      • sudo echo "CONF_SWAPSIZE=0" > /etc/dphys-swapfile
      • sudo rm /etc/dphys-swapfile
      • sudo chmod -x /etc/init.d/dphys-swapfile

      All attempts to kill the swap service failed! Upon a reboot, a 100MB swapfile is restored and activated.

      Anyone have a working solution?