Decrease swap file size

Hey there,

I increased the swap file size from my old raspberry pi 3 (1 GB RAM) to counter random crashes. Which solved the issue at that time. I have now upgraded to a different setup with 8Gb of RAM which makes the swap file unnecesary. The Swapfile is currently about 1.8GB big and I want to decrease it to maybe 0.1 or 0.2 GB. How can I decrease the swap file size or even delete it completely?

I have tried numerous of commands, which all do not seem to work or dont have permission to execute.

Regards

Running Homeassistant OS

This isn’t really an HA question and would depend also on the exact OS you’re running. Disabling swap is generally not recommended. You’ll find lots of hits doing a Google search though.

I’m running Home Assistant OS and googled before creating this topic, but no solution seems to work. I am quite new to linux.

There is an installation topic you could move this to then. This section is perhaps not the best for your question. Unfortunately, I can’t say more about HAOS, since I don’t use that installation method, but I would say it’s a hands-off method, meaning you shouldn’t need to fiddle with it. If you do, you probably need to use another installation method, which will come with added responsibility and understanding.

Thanks I will move it. I already fiddled with it and want to go back to the default. I knew that it was not the recommended way but at that time i’d rather prefer going that route than having to restart HA every hour.