How to setup Zram on MX 19

Message
Author
denis12
Posts: 33
Joined: Sat Apr 27, 2019 6:56 am

How to setup Zram on MX 19

#1 Post by denis12 »

On Manjaro I do this for 4 core cpu and 8gb ram:

$ su

$ nano /etc/modules-load.d/zram.conf

zram

$ nano /etc/modprobe.d/zram.conf

options zram num_devices=4

$ nano /etc/udev/rules.d/99-zram.rules

KERNEL=="zram0", ATTR{disksize}="1024Mb" RUN="/usr/bin/mkswap /dev/zram0", TAG+="systemd"
KERNEL=="zram1", ATTR{disksize}="1024Mb" RUN="/usr/bin/mkswap /dev/zram1", TAG+="systemd"
KERNEL=="zram2", ATTR{disksize}="1024Mb" RUN="/usr/bin/mkswap /dev/zram2", TAG+="systemd"
KERNEL=="zram3", ATTR{disksize}="1024Mb" RUN="/usr/bin/mkswap /dev/zram3", TAG+="systemd"

$ nano /etc/fstab

/dev/zram0 none swap defaults 0 0
/dev/zram1 none swap defaults 0 0
/dev/zram2 none swap defaults 0 0
/dev/zram3 none swap defaults 0 0

$ echo "vm.swappiness=40" > /etc/sysctl.d/swap.conf

nano /etc/fstab I comment old swap by #

But after these manupilations I got swap 0k/0k

denis12
Posts: 33
Joined: Sat Apr 27, 2019 6:56 am

Re: How to setup Zram on MX 19

#2 Post by denis12 »

I moved Zram script to /etc/init.d/zram after I checked by command $ lsmod | grep zram

zram 28672 4
zsmalloc 28672 1 zram

Does it mean it were installed? How it is work. Does it work for all my 4-core or only 1-core cpu? But I see swap file in my system 2gb

subluminal
Posts: 51
Joined: Tue Oct 15, 2019 9:40 am

Re: How to setup Zram on MX 19

#3 Post by subluminal »

I would be interested in knowing how to set up ZRAM as well.
By the way, I found this article.

https://wiki.debian.org/ZRam

P.S. Haven't tried it myself.

subluminal
Posts: 51
Joined: Tue Oct 15, 2019 9:40 am

Re: How to setup Zram on MX 19

#4 Post by subluminal »

Ok I decided to give the wiki guide a go myself.

Ended up with 2.8 GB ZRAM and 4 GB physical RAM Also disabled swap partition from fstab.. Works smooth and fast enough and no crashes yet.

subluminal
Posts: 51
Joined: Tue Oct 15, 2019 9:40 am

Re: How to setup Zram on MX 19

#5 Post by subluminal »

Ok now trying with swap partition enabled + higher priority ZRAM.

Post Reply

Return to “General”