Package Details: zramswap 5-1

Git Clone URL: https://aur.archlinux.org/zramswap.git (read-only, click to copy)
Package Base: zramswap
Description: Sets up zram-based swap devices on boot
Upstream URL: http://en.wikipedia.org/wiki/ZRam
Licenses: GPL
Submitter: Svenstaro
Maintainer: rpodgorny
Last Packager: rpodgorny
Votes: 230
Popularity: 1.57
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 »

TriMoon commented on 2020-10-30 13:18

@rpodgorny, The script i posted as-is is using GiB as default SIZE_TYPE as mentioned, you are free to change that default into KiB either in the script source or in your config :)

PS: kB of meminfo is equal to KiB.... Also most modern desktops have memory sticks in multiple of GigaBytes nowerdays, thats why i set the default to GiB

rpodgorny commented on 2020-10-30 12:37

@TriMoon: cool, nice work!

i'll include that but first please get rid of the SIZE_TYPE thing. please pick a fixed unit (i'd use kB as it's used in /proc/meminfo) and stick to that. the reason being the ability to manage many systems at once without added complexity.

imagine an ansible script being run on your 100 machines ranging from raspberry-pis to fat servers and using for example MemAvailable from /proc/meminfo to set zramswap size accordingly. you surely don't want to reimplement the multiplication and stuff... :-(

TriMoon commented on 2020-10-30 12:14

Please update the script accordingly... I improved the script a bit and removed the dependency on grep and awk... I posted it here: https://forum.manjaro.org/t/improved-zramswap/34767

edit Replaced the source here with a link so i can keep it in one place.

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 ))
   (( MEM= MEM_TOTAL * $ZRAM_SIZE_PERCENT / 100 ))
   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! ;-)