mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
872 B
872 B
ZRAM
TODO
TL;DR
$ grep 'swap' /etc/fstab
/dev/zram0 none swap sw 0 0
$ cat /etc/modules-load.d/zram.conf
zram
# Create a zram block device with total capacity of 2x the total RAM.
# Size is determined by the 'echo ...' part.
$ cat /etc/udev/rules.d/10-zram.rules
KERNEL=="zram0", \
SUBSYSTEM=="block", \
ACTION=="add", \
ATTR{initstate}=="0", \
PROGRAM="/bin/sh -c 'echo $(($(LANG=C free --kilo | sed --silent --regexp-extended s/^Mem:\ (0-9+)\ +.$/\1/p)*2))KiB'", \
ATTR{disksize}="$result", \
RUN+="/sbin/mkswap $env{DEVNAME}", \
TAG+="systemd"