Package Details: zramswap 5-1

Git Clone URL: (read-only, click to copy)
Package Base: zramswap
Description: Sets up zram-based swap devices on boot
Upstream URL:
Licenses: GPL
Submitter: Svenstaro
Maintainer: rpodgorny
Last Packager: rpodgorny
Votes: 228
Popularity: 0.59
First Submitted: 2011-10-05 23:35
Last Updated: 2019-12-20 16:58

Required by (0)

Sources (3)

Latest Comments

1 2 3 4 5 6 ... Next › Last »

rpodgorny commented on 2019-12-20 16:59

@mirh: added but untesed. feel free to try (and report if you encounter any problems).

mirh commented on 2019-12-20 11:00

Is it possible to include @telsch patch? Using zstd is a no-brainer nowadays.

EDIT: thank you!

Sandm commented on 2019-07-07 10:24

@rpodgorny there are bashisms in zramctrl script and it basically not operable. Not everybody link /bin/sh to /bin/bash. So please either remove bashisms or use #!/bin/bash in this script, not #!/bin/sh

telsch commented on 2019-06-14 20:06

why not make compression configurable?

--- /tmp/zramctrl       2019-05-07 22:03:36.000000000 +0200
+++ /usr/lib/systemd/scripts/zramctrl   2019-06-14 22:01:00.554880553 +0200
@@ -11,6 +11,9 @@
   (( MEM_TOTAL= `cat /proc/meminfo|grep MemTotal|awk '{print $2}'` * 1024 ))
   modprobe zram
+  if [ -n "$ZRAM_COMPRESSION_ALGO" ]; then
+    echo "$ZRAM_COMPRESSION_ALGO" > /sys/block/zram0/comp_algorithm
+  fi
   echo $MEM > /sys/block/zram0/disksize
   mkswap /dev/zram0 -L zram0
   swapon -p 100 /dev/zram0

shah26842 commented on 2019-05-17 23:37

Why are you using /bin/sh and not /bin/bash? Not everyone have linked their sh to bash. If you are using dash for example, it will break the script.

rpodgorny commented on 2019-05-06 22:41

i've quicky hacked a new version. please try it out...

rpodgorny commented on 2019-05-06 21:51

thanks for all the input. i'll be leaving tomorrow for a week but i'll try to look into this before i leave. otherwise, please be patient... ...also, always patches welcome! ;-)

stuartiannaylor commented on 2019-05-06 19:37

Still does strange things like create multiple devices when zram is multi-stream by default.

Doesn't check for existing zram services and so will overwrite.

Also omits the mem_limit cap to control actual memory usage.

Irrespective of alg its still out of date.

Freso commented on 2019-05-06 19:32

I mean, if it hadn’t been changed to specifically use the non-default compression algorithm, upgrading the kernel to 5.1+ would automatically have made lzo-rle what was used by default… I don’t think the script should hardcode the compression method. If people want to use lz4, they can make it do so themselves. Trust that the kernel devs make informed decisions on what compression to use by default?

papakilo commented on 2019-05-06 13:56


I have changed your config and I'm already trying lzo-rle with kernel 5.1:

$ cat /sys/block/zram0/comp_algorithm lzo [lzo-rle] lz4 lz4hc 842 zstd

$ zramctl NAME ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT /dev/zram1 lzo-rle 480,6M 4K 79B 12K 2 [SWAP] /dev/zram0 lzo-rle 480,6M 4K 79B 12K 2 [SWAP]

Now I'm testing if really faster than lz4...