Zram: Difference between revisions
Ktpss95112 (talk | contribs) (add trouble shooting) |
(→Configuration: add zramctl) |
||
| Line 17: | Line 17: | ||
Start services:{{Cmd|# rc-service zram-init start}} | Start services:{{Cmd|# rc-service zram-init start}} | ||
Check overall status: {{Cmd|# zramctl}} | |||
View the ZRAM drive:{{Cmd|# cat /proc/swaps}} | View the ZRAM drive:{{Cmd|# cat /proc/swaps}} | ||
Latest revision as of 12:13, 11 January 2026
This page documents how to set up ZRAM in Alpine Linux. Zram can be used as an alternative to Swap partition.
Installation
Install the neccessary packages:
# apk add zram-init
Configuration
For a basic ZRAM swap, configure ZRAM by editing the file /etc/conf.d/zram-init as follows:
Contents of /etc/conf.d/zram-init
Advanced parameters can be found in the source repo.
Start services:
# rc-service zram-init start
Check overall status:
# zramctl
View the ZRAM drive:
# cat /proc/swaps
Check Algorithms:
# cat /sys/block/zram0/comp_algorithm
Advanced setups may also add these parameters to /etc/sysctl.conf as follows:
Contents of /etc/sysctl.conf
To ensure that service starts during next reboot:
# rc-update add zram-init
Troubleshooting
Check whether ZRAM's module is loaded:
# lsmod | grep zram
If not loaded, use modprobe to load it: (however, it should be automatically loaded if load_on_start=yes is in the configuration)
# modprobe zram