Jump to content


Photo

[MOD] Swap to /system & /data & /cache


  • Please log in to reply
32 replies to this topic

#1
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 71 posts
Hi everyone!

I made an init.d script, which creates 3 swap files (85 MB each), first in the /system, second in the /data, third in the /cache, and they significantly boost multitasking performance, becuse they're working in parallel mode.

I am using CM 10.1, but I think it it works with all roms.

You have to install busybox 1.20.2 from stericson with the pro app (I can't post it, because it's a paid app), because the other versions can't use swap files in parallel mode (the swapon applet does't have "-p" parameter, to set priorities, so the script exits, and doesn't create swap files), which is the main advantage of this script.

The script set swappiness to 90 ,removes and recreates the swap files at boot, so the boot time increased to 3 mins.
If you delete the "rm .../swap*.img" from the script, it will not deletes the files, so the boot time will be normal.
The matter why I remove, then recreate the files is that they dont't stress the specific part of the eMMC in this way.

Usage:
Backup your current rom.
Install busybox 1.20.2.
Copy 02Swap2SysDataCache file to /system/etc/init.d folder, and set permissions to 755 (rwxr-xr-x).
Reboot (2,5-3 mins each boot).
Enjoy!

You can check swaps with "cat /proc/swaps" command, if they have the same priority, you're done. :-)

Luca020400 made a flashable zip, download, and enjoy!
Thanks again luca! :)
Flashable zip

Attached Files


Edited by kannasbor0, 17 September 2014 - 06:13 PM.

  • 1

#2
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

 

You can check swaps with "cat /proc/swaps" command, if they have the same priority, you're done. :-)

 

It shows /dev/block/zram0 which is a partition with priority -1 and three files /system/swap1.img, /data/swap2.img and /cache/swap3.img all with priority 1

 

Does this mean all is well? :))


  • 0

#3
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 71 posts

It shows /dev/block/zram0 which is a partition with priority -1 and three files /system/swap1.img, /data/swap2.img and /cache/swap3.img all with priority 1

Does this mean all is well? :))

Yep, it's working! :)
I suggest you to disable zram (add a ".txt" extension to the name of the zram the script in the init.d folder), it stresses the cpu, so eats your battery.

Edit: Please give me feedback, does it boost your multitasking performance?

Edited by kannasbor0, 03 May 2014 - 08:14 AM.

  • 0

#4
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Yep, it's working! :)
I suggest you to disable zram (add a ".txt" extension to the name of the zram the script in the init.d folder), it stresses the cpu, so eats your battery.

Edit: Please give me feedback, does it boost your multitasking performance?

Sorry for belated answer, was busy these days.

 

Could you please explain in more detail? In /system/etc/init.d I have files 00banner, 50selinuxrelabel, 90userinit, and your script. Which one do you mean?

 

And yes it helps a lot! Antutu went from 5731 to 7749!

 

P. S. In the thread http://www.modaco.co...ap-zram-fstrim/ Victod proposes to use the command

swapoff /dev/block/zram0

May I just add this line to your script?

 

P. P. S. Question obsolete, already managed to disable zram and installed fstrim, antutu now says 7777


Edited by anotherjib, 06 May 2014 - 10:25 AM.

  • 0

#5
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 71 posts
Sorry, i was busy too with my job and my exams...
Glad to see that it helped! :)

  • 0

#6
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Forgot to specify - mine is slimkat 4.9 http://www.modaco.co...icial-05052014/

Created no problems so far


  • 0

#7
porozex

porozex

    Regular

  • Members
  • PipPip
  • 145 posts
  • Devices:Huawei Y300-0100

works perfectly thx :)


  • 0

#8
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 71 posts

works perfectly thx :)


You're welcome! :-)

  • 0

#9
SH3H1

SH3H1

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,264 posts
  • Gender:Male
  • Devices:Xiaomi Redmi 1S
What to do with the busybox file?

  • 0

#10
porozex

porozex

    Regular

  • Members
  • PipPip
  • 145 posts
  • Devices:Huawei Y300-0100

What to do with the busybox file?

you must install it with the pro app in the market


  • 0

#11
tarinka

tarinka

    Newbie

  • Members
  • Pip
  • 42 posts
  • Devices:huawei y300
  • Twitter:@zoka

Can you write to me step by step how to install this script, because i have installed this http://www.modaco.co...ith-all-phones/. How to remove and install yours. I don't understand where to type this command   "cat /proc/swaps" command. Thnx in advanced, i use slimkat 5.9


  • 0

#12
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Can you write to me step by step how to install this script, because i have installed this http://www.modaco.co...ith-all-phones/. How to remove and install yours. I don't understand where to type this command   "cat /proc/swaps" command. Thnx in advanced, i use slimkat 5.9

You can enter "cat /proc/swaps" in (for example) Android Terminal Emulator. You can also use it to set permissions for the script.

First you must have busybox installed (and of course you must have root access).
Unzip the script anywhere on your phone;
Find it with simple explorer and copy it to the /system/etc/init.d folder
Now run terminal emulator; you will get a black window with "something@someotherthing:/ $"
Type su root (enter)
You must get "yetanotherthing #"
Type cd /system/etc/init.d (enter)
Type chmod 755 02Swap2SysDataCache (enter)
Reboot
To check if the script works - run terminal emulator again and type cat /proc/swaps
It must list three swap files (in /system, /data and /cache folders)

As for uninstalling the swapdragon script - I think the right way is to ask them for a flashable uninstall zip. Their script writes several things to build.prop and somewhere else and it is impractical to change them back by hand.

  • 0

#13
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100
I've just noticed that your script ceased to create the first swap file (in /system); the other two are there but this one is missing.
All three were there earlier but now only the second and the third appear. Do you know what to do? I've updated ROM several times (I have slimkat for u8833 (Huawei y300-0100)) but I did not notice after which update did it happen. Right now I'm on 6.6. Antutu is worse than before - 7540

  • 0

#14
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

I've just noticed that your script ceased to create the first swap file (in /system); the other two are there but this one is missing.
All three were there earlier but now only the second and the third appear. Do you know what to do? I've updated ROM several times (I have slimkat for u8833 (Huawei y300-0100)) but I did not notice after which update did it happen. Right now I'm on 6.6. Antutu is worse than before - 7540

An update to the quoted question: my slimkat is currently 7.0, still the same problem. When I run the script manually then it works well - does create the system swap file. Any suggestions?

  • 0

#15
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 71 posts

An update to the quoted question: my slimkat is currently 7.0, still the same problem. When I run the script manually then it works well - does create the system swap file. Any suggestions?


Maybe the script runs too early or too late at boot, so you have to rename to 05-....... to make it work again.
Regards.

  • 1

#16
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Maybe the script runs too early or too late at boot, so you have to rename to 05-....... to make it work again.

Tried, does not help :(
Would you suggest to try any other number? In /system/etc/init.d I currently have
00banner
05Swap2SysDataCache
09Dis-Zram0
50selinuxrelabel
77fstrim
90userinit
99SuperSUDaemon

  • 0

#17
luca020400

luca020400

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 2,978 posts
  • Gender:Male
  • Location:Genoa Italy
  • Interests:Linux Android
  • Devices:Moto G 2014
Have you busybox pro ??
Or install the synopsis kernel

  • 0

Aospa 4.4.4 My Topic

Mahdi Rom 4.4.4 My Topic

Carbon Rom 4.4.4 My Topic

Carbon Rom 4.2.2 My Topic

Nameless Chil360 Topic

All bootanimation My Personal Server

Mega script collection My Personal Server
 
Sorry for my bad english ( I promise you : I will learn English well XD )
I'm Italian and I'm 14 years old
Remember to click the thanks button


#18
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Have you busybox pro ??
Or install the synopsis kernel

Yes I have busybox pro, and in fact the script worked fine before slimkat 6.2 (I believe; maybe later maybe earlier)
Do you still advise to try synopsis? If yes, how do I flash it?

  • 0

#19
luca020400

luca020400

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 2,978 posts
  • Gender:Male
  • Location:Genoa Italy
  • Interests:Linux Android
  • Devices:Moto G 2014
Flash the fonzrepack

  • 0

Aospa 4.4.4 My Topic

Mahdi Rom 4.4.4 My Topic

Carbon Rom 4.4.4 My Topic

Carbon Rom 4.2.2 My Topic

Nameless Chil360 Topic

All bootanimation My Personal Server

Mega script collection My Personal Server
 
Sorry for my bad english ( I promise you : I will learn English well XD )
I'm Italian and I'm 14 years old
Remember to click the thanks button


#20
anotherjib

anotherjib

    Regular

  • Members
  • PipPip
  • 98 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Flash the fonzrepack

No avail, /system swap still missing :(

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users