7cfm
Posts: 5
Joined: Mon Nov 11, 2019 8:35 am

Re: Permanently disable swap on Raspbian Buster

Thu Nov 14, 2019 10:50 am

I posted a query /forums/viewtopic.php?f=66&t=256718 yesterday which is hopefully self explanatory, but haven’t received much response. The posts here, although interesting and knowledgeable, do not directly address my question about the particular memory management behaviour I am observing and I would like to understand it. Could some-one who understands Linux memory management better than I do have a look?

Apologies if this request breaks forum etiquette

Barabba
Posts: 47
Joined: Wed Aug 03, 2016 3:49 pm

Re: Permanently disable swap on Raspbian Buster

Thu Mar 05, 2020 10:18 am

thatchunkylad198966 wrote:
Fri Aug 16, 2019 6:36 pm
After I run the following commands and I've rebooted, no more swap.

Code: Select all

sudo dphys-swapfile swapoff && \
sudo dphys-swapfile uninstall && \
sudo systemctl disable dphys-swapfile
pi@raspberrypi:~ $ free -h
total used free shared buff/cache available
Mem: 3.8Gi 615Mi 1.8Gi 96Mi 1.4Gi 2.9Gi
Swap: 0B 0B 0B
pi@raspberrypi:~ $
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.58-v7l+ #1245 SMP Fri Jul 12 17:31:45 BST 2019 armv7l GNU/Linux
pi@raspberrypi:~ $
I've used this post to remove swap from my RP3,

for the code: ]sudo dphys-swapfile swapoff && \ it had no output and returned to prompt after about 30 seconds
sudo dphys-swapfile uninstall && \ had no output and still working (not quit to prompt) for about 10 minutes, it's not normal, something went wrong.
I opened another shell (while the previous command still working), and typed swapon -s and I had no output, it means swap now is dleeted, in this new ssh shell I typed sudo systemctl disable dphys-swapfile and I had this output:
dphys-swapfile.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable dphys-swapfile

The other command still working, I'm afraid to reboot and have problems, hope you can suggest me something, thank you

Return to “Troubleshooting”