<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ktpss95112</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ktpss95112"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Ktpss95112"/>
	<updated>2026-05-05T19:08:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Zram&amp;diff=30194</id>
		<title>Zram</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Zram&amp;diff=30194"/>
		<updated>2025-06-04T18:18:52Z</updated>

		<summary type="html">&lt;p&gt;Ktpss95112: add trouble shooting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents how to set up [https://docs.kernel.org/admin-guide/blockdev/zram.html ZRAM] in Alpine Linux. Zram can be used as an alternative to [[Swap]] partition.&lt;br /&gt;
&lt;br /&gt;
== Installation == &lt;br /&gt;
&lt;br /&gt;
Install the neccessary packages:{{Cmd|# apk add {{pkg|zram-init}}}}&lt;br /&gt;
&lt;br /&gt;
== Configuration == &lt;br /&gt;
&lt;br /&gt;
For a basic ZRAM swap, configure ZRAM by editing the file {{path|/etc/conf.d/zram-init}} as follows:{{Cat|/etc/conf.d/zram-init|&amp;lt;nowiki&amp;gt;load_on_start=yes&lt;br /&gt;
unload_on_stop=yes&lt;br /&gt;
num_devices=1&lt;br /&gt;
type0=swap&lt;br /&gt;
size0=8000&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Advanced parameters can be found in the [https://github.com/vaeth/zram-init/blob/main/openrc/conf.d/zram-init source repo].&lt;br /&gt;
&lt;br /&gt;
Start services:{{Cmd|# rc-service zram-init start}}&lt;br /&gt;
&lt;br /&gt;
View the ZRAM drive:{{Cmd|# cat /proc/swaps}}&lt;br /&gt;
&lt;br /&gt;
Check Algorithms:{{Cmd|# cat /sys/block/zram0/comp_algorithm}}&lt;br /&gt;
&lt;br /&gt;
Advanced setups may also add these parameters to {{path|/etc/sysctl.conf}} as follows:{{Cat|/etc/sysctl.conf|&amp;lt;nowiki&amp;gt;vm.page-cluster=0&lt;br /&gt;
vm.extfrag_threshold=0&lt;br /&gt;
vm.swappiness=100&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
To ensure that service starts during next reboot: {{Cmd|# rc-update add zram-init}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting == &lt;br /&gt;
&lt;br /&gt;
Check whether ZRAM&#039;s module is loaded: {{Cmd|# lsmod &amp;amp;#124; grep zram}}&lt;br /&gt;
&lt;br /&gt;
If not loaded, use &amp;lt;code&amp;gt;modprobe&amp;lt;/code&amp;gt; to load it: (however, it should be automatically loaded if &amp;lt;code&amp;gt;load_on_start=yes&amp;lt;/code&amp;gt; is in the configuration) {{Cmd|# modprobe zram}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/vaeth/zram-init/blob/main/openrc/conf.d/zram-init sample zram-init file on official website]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Zram Zram in Arch Wiki]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/zram Zram in Wikipedia]&lt;br /&gt;
&lt;br /&gt;
[[Category:System Administration‏‎]]&lt;br /&gt;
[[Category:Storage‏‎‏‎]]&lt;br /&gt;
[[Category:Kernel]]&lt;/div&gt;</summary>
		<author><name>Ktpss95112</name></author>
	</entry>
</feed>