# Zram configuration

**URL:** <https://forum.openwrt.org/t/zram-configuration/3560>\
**Category:** Installing and Using OpenWrt\
**Created:** [May 6, 2017, 1:02pm UTC](https://forum.openwrt.org/t/zram-configuration/3560 "2017-05-06T13:02:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tului](https://forum.openwrt.org/letter_avatar/tului/32/6_449c533f586939b6e5f246632a46421f.png) [@tului](https://forum.openwrt.org/u/tului)\
**Post date:** [May 6, 2017, 1:02pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/1 "2017-05-06T13:02:12Z")

</div>

Upon installing zram I get an error that device zram1(which would be the zram swap for the second of the two cores of the CPU) isn't available. Where are the configuration files for zram located so I can go in and manually inspect them and edit them to get this working?

---

<div class="post-metadata">

**Author:** ![eduperez](https://forum.openwrt.org/user_avatar/forum.openwrt.org/eduperez/32/2066_2.png) [@eduperez](https://forum.openwrt.org/u/eduperez)\
**Post date:** [May 6, 2017, 1:10pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/2 "2017-05-06T13:10:43Z")

</div>

The number of devices created by zram is a parameter sent to the kernel module during initialization; for example, I use `modprobe -sv zram num_devices=4` in a script.

---

<div class="post-metadata">

**Author:** ![tului](https://forum.openwrt.org/letter_avatar/tului/32/6_449c533f586939b6e5f246632a46421f.png) [@tului](https://forum.openwrt.org/u/tului)\
**Post date:** [May 6, 2017, 1:15pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/3 "2017-05-06T13:15:13Z")

</div>

Why then is it trying to mount 2 devices, which is the correct amount given the number of cores, but only having created 1?

---

<div class="post-metadata">

**Author:** ![tului](https://forum.openwrt.org/letter_avatar/tului/32/6_449c533f586939b6e5f246632a46421f.png) [@tului](https://forum.openwrt.org/u/tului)\
**Post date:** [May 6, 2017, 1:16pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/4 "2017-05-06T13:16:02Z")

</div>

Additionally, where is the script that it sets up on its own at install? I'd prefer it just install the bloody modules and what not and let me configure it but it tries to be smart and ends up failing.

---

<div class="post-metadata">

**Author:** ![jow](https://forum.openwrt.org/user_avatar/forum.openwrt.org/jow/32/13_2.png) [@jow](https://forum.openwrt.org/u/jow)\
**Post date:** [May 6, 2017, 1:18pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/5 "2017-05-06T13:18:38Z")

</div>

The script called upon opkg install is `/etc/init.d/zram start`. As far as I know there is no dedicated configuration for it.

---

<div class="post-metadata">

**Author:** ![jow](https://forum.openwrt.org/user_avatar/forum.openwrt.org/jow/32/13_2.png) [@jow](https://forum.openwrt.org/u/jow)\
**Post date:** [May 6, 2017, 1:19pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/6 "2017-05-06T13:19:38Z")

</div>

> [@tului](#):
>
> I'd prefer it just install the bloody modules

In this case simply install `kmod-zram` instead of `zram-swap`.

---

<div class="post-metadata">

**Author:** ![tului](https://forum.openwrt.org/letter_avatar/tului/32/6_449c533f586939b6e5f246632a46421f.png) [@tului](https://forum.openwrt.org/u/tului)\
**Post date:** [May 6, 2017, 2:22pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/7 "2017-05-06T14:22:16Z")

</div>

I am getting an error trying to install kmod-zram due to certain modules failing to install. Below I have attached the output of just trying to install a single one of the modules manually:

root@LEDE:/lib/modules/4.4.61# opkg install kmod-lib-zlib-deflate  
Installing kmod-lib-zlib-deflate (4.4.61-1) to root...  
Downloading [http://downloads.lede-project.org/releases/17.01.1/targets/mvebu/generic/packages/kmod-lib-zlib-deflate\_4.4.61-1\_arm\_cortex-a9\_vfpv3.ipk](http://downloads.lede-project.org/releases/17.01.1/targets/mvebu/generic/packages/kmod-lib-zlib-deflate_4.4.61-1_arm_cortex-a9_vfpv3.ipk)  
Configuring kmod-lib-zlib-deflate.  
failed to find a module named zlib\_deflate  
Collected errors:

- pkg\_run\_script: package "kmod-lib-zlib-deflate" postinst script returned status 255.
- opkg\_configure: kmod-lib-zlib-deflate.postinst returned 255.

---

<div class="post-metadata">

**Author:** ![HsTuah](https://forum.openwrt.org/user_avatar/forum.openwrt.org/hstuah/32/57684_2.png) [@HsTuah](https://forum.openwrt.org/u/HsTuah)\
**Post date:** [July 29, 2022, 8:09pm UTC](https://forum.openwrt.org/t/zram-configuration/3560/8 "2022-07-29T20:09:08Z")

</div>

how about do it for mt300n-v2 mango
