zram configuration This note was created on 2023-06-15 This note was last edited on 2024-01-14 === Manually enable for current session === To set up one zstd compressed zram device with 8GiB capacity and a higher-than-normal priority: # modprobe zram # zramctl /dev/zram0 --algorithm zstd --size 8G # mkswap -U clear /dev/zram0 # swapon --priority 100 /dev/zram0 To disable it again, either reboot or run: # swapoff /dev/zram0 # modprobe -r zram === Using zram-generator === 1. Install "systemd-zram-generator" package. 2. Create configuration file "/etc/systemd/zram-generator.conf": ~~~ [zram0] zram-size = ram / 2 compression-algorithm = zstd swap-priority = 100 fs-type = swap ~~~ 3. Reload daemons: # systemctl daemon-reload 4. Enable and start the service: # systemctl enable --now systemd-zram-setup@zram0.service 5. Check if zram is working: # systemctl status systemd-zram-setup@zram0.service # zramctl === Disable zram on Fedora === Just uninstall "zram-generator-defaults": # dnf remove zram-generator-defaults To enable again - install the same package back.