How noobs enable zram in Arch Linux

zram is great, it helps your machine stay responsive quite a bit longer during RAM and swap intensive tasks than it would without it.

This is how you enable zram in Arch Linux. It’s part of ArchWiki already but not exactly described in noob-friendly way, so here it is:

# Check if it's already enabled -- if "zram" is mentioned, DO NOT CONTINUE!
$ swapon

# If there is no mention of "zram", this installs the zram-generator package.
$ sudo pacman -S zram-generator

# This prepares configuration of the zram module.
$ sudo bash -c "cat <<EOF >/etc/systemd/zram-generator.conf
[zram0]
zram-size = ram / 2
EOF
"

# Changes automatically take effect after reboot, so...
$ reboot

# After reboot, check with this command. it should mention something with "zram".
$ swapon

Posted

in

, ,

by

Tags: