How to change SWAP size?

Hi,
I want to change the SWAP size on my CoreELEC.I have tried to edit /storage/.config/swap.conf and restarted my system,but it seems that doesn’t work.Anyone knows how to change the SWAP size?
Thanks in advance!

Hi @richie

you can try creating a systemd unit file (there are some examples in /storage/.config/system.d/README

More documentation is available here : https://www.freedesktop.org/software/systemd/man/systemd.swap.html

I have looked into it and there’s something I don’t get : in /usr/lib/systemd/system/swap.service there is a ConditionPathExists=/proc/swaps
It does not exist, so the service fails to start and the swap file is not created.

Maybe useful: https://forum.libreelec.tv/thread/15109-how-to-enable-swapfile-on-libreelec/?postID=115558

It looks like the swap is not configured in the kernel so it’s a no go.

Edit : Not enabled in the 4.9 kernel but enabled in the 3.14 one.
@richie is it a N2 ?

No,it’s a Phicomm N1,I installed CoreELEC 8.95.5 on it.

This would of helped if you had told us that from the beginning. :slight_smile:

We are unable to offer any support for the Phicomm N1.

The images for this device was not created by us but by an unknown third party, we don’t know what modifications was made to our source for it and therefore can’t help, sorry.

I would contact the developer/website from where you downloaded the image and ask them to contact us so we can add support properly and make you a more up to date version.

I’ve read this post before and did exactly as it shows,but it doesn’t help.I notice that my swapfile is in /storage/.cache/swapfile,not /storage/.config/swapfile,is this the problem?

Sorry for my mistake.
According to the author,he changed nothing but the startup script.He also provides a 9.0.1 version but I don’t update yet.
I’m afraid it would be a little difficult for you to contact him because he post it on a chinese forum.

I would suggest trying his 9.0.1 version then.
If this still doesn’t work, ask the author for help.

We can’t help you with it in any way.
You are using an unsupported (beta) version of CE on an unsupported device with an image not created by us.

Finally I find the problem!
The default swapfile size is “128”,if I want to change it,I have to delete both swap.conf and the SWAPFILE before I make a modification.I just modified swap.conf and restarted system before,that’s the reason it did not work.