How to disable the zram that default in kernel?

ethan92

Member
Jan 19, 2013
15
0
0
Kuching
Recently i has flashed a kernel that has zram in default, 60MB.
I has deleted the file in dev/block but after reboot it appear again:mad:

Can somebody help me?

Is it no choice then to flash another kernel? Well, any recommendation?

Thx first:D

Sent from my SK17i using xda app-developers app
 

ethan92

Member
Jan 19, 2013
15
0
0
Kuching
No such script in init.d folder.

I guess because of the kernel is integrated with zram, mean that when successfully flash it, it automatically give you 60MB of zram volume, so no such script exist in the folder.

Or maybe in another folder where i don't know?
:banghead:

Sent from my SK17i using xda app-developers app
 

arielCo

Member
Mar 23, 2011
10
1
0
For anyone still looking

Open a shell on your device either through a Terminal or ADB (recommended), and create a simple script in /etc/init.d with this code:

Code:
for f in /dev/block/zram*; do
    swapoff $f
done
A simple way to create the script from the terminal:
Code:
[email protected]:/ # cat > /etc/init.d/99zram-off <<END
for f in /dev/block/zram*; do
    swapoff $f
done
END
You should get back to the shell prompt.

Then give it execute permissions:
Code:
[email protected]:/ # chmod +x /etc/init.d/99zram-off
Reboot and check:
Code:
 $ free
             total         used         free       shared      buffers
Mem:        851900       827468        24432            0        24196
-/+ buffers:             803272        48628
Swap:            0            0            0
 
  • Like
Reactions: RuffBuster