Why and how to extend ZRAM on L5. A revolution for Librem 5 stability!

If anything, what Kyle described is easier. zramswap (from zram-tools) is a script that takes the nitty-gritty away. But if you look at /usr/sbin/zramswap, it invokes all the same commands.

3 Likes

Maybe use the other suggestion? systemctl status -l systemd-zram-setup@zram0.service.

2 Likes

Hi :slightly_smiling_face::wave: I’m trying to set my zram but I’m having same Flanders51 problem and Lionel’s suggestion didn’t work for me (reboot and make the procedure again).
Here my screenshots.
Please some help?
Thank you so much :pray:



1 Like

:pensive:



1 Like

Show us your /usr/lib/systemd/zram-generator.conf.d/librem5.conf please.
Maybe, kill some running apps.and restart service again…
Do you have any autostarting apps?

2 Likes

I have not tried the procedure from the original post. Instead, I added the following configuration file and rebooted. I would suggest it instead. The documentation is available in man zram-generator.conf.

$ cat /etc/systemd/zram-generator.conf.d/librem5.conf
[zram0]
zram-fraction = 2
max-zram-size = none

That configuration file overrides the configuration file with the same name, which is provided by Purism.

$ cat /usr/lib/systemd/zram-generator.conf.d/librem5.conf
[zram0]

So, this combines the following advice.

5 Likes

[zram0]

Thank you :slightly_smiling_face::pray:

1 Like

Ok did it! Then I rebooted! I’m opening everything now to fill my ram. Here a pic.

1 Like

Please I’m trying to do that. What means it?
I’ve to create a second file and save it, like this one, in my microsd?
Thank you

1 Like

I do not know. However, the following bit of the log seems to indicate that /dev/zram0 is busy by some other process when zram-generator tries to configure it.

I do not know how to investigate it. But I found the following suggestion:

As far as I know Debian has two packages that makes configuring swap on a zram device fairly easy.
They are “zram-tools” and “systemd-zram-generator”.
You should probably check that you have only one installed.

I only have systemd-zram-generator installed of the two.

2 Likes

Only do this (don’t follow any other procedure, i cannot help you), or Why and how to extend ZRAM on L5. A revolution for Librem 5 stability! - #34 by riabenko (may be a better procedure):
I did on my 3 librem 5:
1.Reboot
2.Close immediately any running app because of autostart (or better: remove them from the folder temporarily).
3. And immediately in terminal copy past this in terminal:

sudo tee /usr/lib/systemd/zram-generator.conf.d/librem5.conf <<EOF
[zram0]
zram-fraction = 2
max-zram-size = none
EOF
sudo systemctl restart systemd-zram-setup@zram0
1 Like

That means any path of a script like /home/purism/myscrip.sh, that contains the commands you want to run at boot. has to be replaced by the text you want at this place.
For our purpose, the script /home/purism/myscrip.sh should contain:

#!/bin/sh
sudo swapoff /dev/zram0
sudo zramctl --reset /dev/zram0
sudo zramctl --find --size 5G
#/dev/zram0
sudo mkswap /dev/zram0
sudo swapon /dev/zram0
2 Likes

:sweat_smile: what’s wrong, please?:pray:



1 Like

After reboot

1 Like

I would have liked to see the full text. Go to the menu (top right) and click on “zoom -”
Have you done chmod +x ~/Documents/2.sh to make the script executable, otherwise, you need to have ExecStart=/usr/bin/bash /home/purism/Documents/2.sh in the service file. (restart the service after modification).
PS: I have edited my original post to do the changes through one or two scripts. I hope it is clearer for all now after the replies.

2 Likes

Thank you, Lionel :pray:

PS: yes! I chmod +x it

1 Like

That screenshot is rotated for me. Difficult to read!

1 Like

Corrected image:

1 Like

2.sh needs to start with a line #! /shell where /shell means a path to a valid shell e.g. /bin/bash Does it?

2 Likes

Well seen!. It is also why i converted my instructions in my original post, to avoid typing mistakes.

3 Likes