Jump to content
Sign in to follow this  

[ROMs with init.d support] Using swap in the /cache partition (modified version of kedazo's topic)

Recommended Posts

So, kedazo put the swapfile in /data, but I read other topics and forums, and decided to put swap into /cache, because it's unused. Here's the way:


Connect your phone to PC (debug on), open a cmd window and navigate to the folder, where the adb.exe file is. Then type:


adb shell [enter]

su [enter]


You have to see a '#', type:


# dd if=/dev/zero of=/cache/swapfile bs=1048576 count=200 [enter] (I use 200 mb of swap, it can be modified)

# mkswap /cache/swapfile [enter]


Then you have to extract and push the script I attached to /system/etc/init.d with adb push.

Finally, you have to set permissions and start the script. It can be done manually with a root explorer eg. ES File Manager, or from adb shell typing this:


adb shell [enter]


su [enter]

# chmod 0777 /system/etc/init.d/userinit.sh [enter]

# /system/etc/init.d/userinit.sh [enter]


And then you can check what you did:


adb shell [enter]

su [enter]

#free [enter]


In swap, you have to see the size of swap you created. It has to work on every rom supporting init.d


Edited by shadowprince94

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this