Post Reply

[Script]New "Low Storage" Notification fix

OP Wendigogo

21st May 2012, 04:48 PM   |  #1  
OP Senior Member
Flag Lyon
Thanks Meter: 311
 
531 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Here we go !

Starting point is from CyanogenMod Captivate forum and some improvement were added here and there. Credits are recalled and came from this thread : [SCRIPT][CM7/9] /datadata/ low storage notification lagless fix - init.d script.

Background :
CyanogenMod (CM) based roms on our I9000 (and brothers) uses a small and fast flash chip to store application datas. This make the rom smooth and sweet ... This chip is mounted as /datadata and is about 170Mo.
With a lot of apps (or apps storing lots of stuff there) we faced a "Low storage" notification and our phone becomes laggy.
  • The first idea was to move this /datadata to /data (about 2Go) whose have a lot of free space. This works but the phone became laggy.
  • Then some others devs think about moving back to /datadata frequently accessed files (sqlite database and xml preferences files). First as scripts part then as flashed zip file. The phone becames smoother but not like a "vanilla" CM rom. This is the 1103 datafix in thread linked previously.
  • An xda user suggested to let on /data only library files and move back all other stuff to /datadata. These lib files are only accessed (when used by users) in read mode so the ext4 /data partition is efficient in this way and phone becomes smoother as "vanilla" CM roms. This is the 2903 datafix I made and post in previously linked xda thread.
  • But with this latest datafix, applications cache are stored in /datadata and recent Google apps (like Chrome) fulfilled it quickly : the "Low storage" notification is back !

Next solution :
Like 2903 datafix, only libraries ("lib" and "libs" subdirectories) stay on /data by default.
BUT unlike it you could choose which apps will also store their cache in /data. And this is REVERSIBLE : if one of selected app becomes laggy you could move back its cache onto /datadata

How to use it :
Make a nandroid backup
Just grab the zip file and flash it in recovery
At reboot, it will revert previous datafix (if there is one) and apply this one. So first boot could take more time (5 minutes max) than "normal" boot.
It also creates a "datafix" directory in /data/local with two files : "move_cache.txt" and "skip_apps.txt".
Just edit the first file (root needed) to add apps whose cache will go back to /data at next boot :
Code:
com.android.chrome
org.mozilla.firefox_beta
will put Google Chrome and Firefox Beta cache on /data. All others apps cache will go to /datadata.
If you want Firefox cache to go back on /datadata, just remove its line in the file and reboot.

In the "skip_apps.txt" file, just put apps you want to fully stay on /data/data. If apps was previously moved to /datadata by the datafix it won't apply; you have to add its name in "skip_apps.txt" file after installing it and before rebooting the phone. On the other hand, if you remove the apps name from "skip_apps.txt" file all but libraries will be moved to /datadata at next reboot.

Requirements :
  • Samsung Galaxy S based phone (GT-I9000, Vibrant, Fascinate, Captivate, etc.)
  • CM based rom (including CM7/9, MIUI and maybe ao(k)sp etc.)
  • Kernel that supports init.d scripts (latest CM9 nightly support it)
  • Busybox installed
  • A fresh nandroid backup

FAQ :
Q : There is 2 zip files, who's the good one ?
A : It depends of your kernel. With stock CM9 kernel use the Datafix20120521. With others like Devil etc., use the SDatafi20120521. The only difference is between the script name : 30datafix or S30datafix. Some recent kernels add a "S" before the init.d script name. Why ? No idea !!!

Q : Will this wipe my phone ?
A : No, it should not delete any data on your phone. But as it's not tested with every phone xda user have it's a good idea to have a fresh nandroid backup

Q : Do I need to reflash the zip file ? When ?
A : The datafix will be erased each time you upgrade/change your rom (including Nightly Builds) or your kernel (many of them "clean" the init.d directory). But if you don't install lots of apps after upgrading you don't really need to install the datafix again : without full wipe, a nandroid restore or an Odin full installation te datafix will stay on.

Q : Is there something to do when backuping my apps ?
A : Nandroid should work without specific option; Titanium Backup users should tick the Preferences > Troubleshooting settings > Follow all symbolic links option. I don't use other backup apps ...

Q : Can I use this on Samsung based rom ?
A : No ! And it's irrelevant cause Samsung roms don't have the "Low storage" issue !

Q : I'm using Slim ICS rom, do I need some busybox fixer etc. ?
A : I don't use SlimICS but all commands in my script call busybox directly so it should work. Let me know if there is still a problem with this !

Q : Why do you change naming of the zip file ?
A : Cause I want ! And it's listed directly in chronological order in terminal (or recovery) in this way.

Q : How can I know which apps use most space on /datadata :
A : Just run as root (in adb or terminal) :
Code:
du -s /datadata/*|sort -n
Downloads :
Box : https://www.box.com/s/6783d86f3840c02db911
Dropbox : https://www.dropbox.com/sh/rwibb0r0fhhyvh6/KaoBoC1BtB
Please don't mirror this.

I put the shell script in attachement here. Just grab it on your sdcard, remove the ".txt" extension and you could run it using Scripter or equivalent (root needed). Please post here if something gone wrong when using it.

Donations :
As I spent some time (and coffee) for this (and april datafix for those following previous xda thread) I think about a donation button. Give me your advise on that please ...
Link for donations

But just a little "Thanks, it works great !" would be great !
Last edited by Wendigogo; 31st May 2012 at 01:02 PM. Reason: Editing FAQ and adding a donation link ;)
The Following 125 Users Say Thank You to Wendigogo For This Useful Post: [ View ]
21st May 2012, 04:51 PM   |  #2  
OP Senior Member
Flag Lyon
Thanks Meter: 311
 
531 posts
Join Date:Joined: Jun 2010
Donate to Me
More
Reserved.

(ten chars)
The Following 3 Users Say Thank You to Wendigogo For This Useful Post: [ View ]
21st May 2012, 04:57 PM   |  #3  
Senior Member
Flag Dublin
Thanks Meter: 18
 
105 posts
Join Date:Joined: Dec 2010
More
Thanks for this. I kept wondering why I would run out of storage all the time. Well, now I know and you fixed it!

Sent from my GT-P7510 using XDA Premium HD app
21st May 2012, 06:02 PM   |  #4  
BradleyR2010's Avatar
Senior Member
Flag GT
Thanks Meter: 373
 
365 posts
Join Date:Joined: Jul 2010
Donate to Me
More
awesome using chrome was causing me FC every once in a while
21st May 2012, 06:19 PM   |  #5  
Senior Member
Thanks Meter: 158
 
741 posts
Join Date:Joined: Oct 2011
Hi,

Nice work.
Something I don't understand - how should I choose which apps I have their cache go to the /data partition? Apps that I frequently access? Apps that take a lot of space?
21st May 2012, 06:53 PM   |  #6  
BradleyR2010's Avatar
Senior Member
Flag GT
Thanks Meter: 373
 
365 posts
Join Date:Joined: Jul 2010
Donate to Me
More
Wendigogo I've previously had an old datafix posted that moved all the files to /data/data and I've only had issues when Chrome filled the cache so Ive ran your script but now /datadata is filled and everything is FC Chrome's cache seems to be in /data/data though

any ideas?
Last edited by BradleyR2010; 21st May 2012 at 09:57 PM.
21st May 2012, 08:02 PM   |  #7  
ImraanK's Avatar
Senior Member
Flag Durban
Thanks Meter: 31
 
451 posts
Join Date:Joined: Oct 2010
More
Er.. is my datadata folder meant to be empty after applying this patch ? Phone is definitely slower.. forgot to do a nandroid too argh.

As per the other fixes.. doubt this is reversible ?

Sent from my GT-I9000 using Tapatalk 2
21st May 2012, 08:16 PM   |  #8  
Senior Member
Thanks Meter: 16
 
147 posts
Join Date:Joined: Sep 2010
More
Quote:
Originally Posted by Wendigogo


Q : Can I use this on Samsung based rom ?
A : No ! And it's irrelevant cause Samsung roms don't have the "Low storage" issue !

Just a stupid question.
Why Samsung Roms dont need it ?
How works the solution of Samsung?

Thanks!
21st May 2012, 08:17 PM   |  #9  
Senior Member
Thanks Meter: 94
 
674 posts
Join Date:Joined: Jul 2010
Very good script. Whats your future plans for this?

It would be really good if this was made into an app that let u select the apps cache you want on /data or /datadata rather than having to edit a text document.

Sent from my GT-I9000 using XDA
21st May 2012, 09:48 PM   |  #10  
Jose_Paramore's Avatar
Senior Member
Flag Torre Del Campo
Thanks Meter: 94
 
678 posts
Join Date:Joined: Oct 2010
More
I've flashed this and now my /datadata partition is empty...

Enviado desde mi GT-I9000 usando Tapatalk 2

Post Reply Subscribe to Thread

Tags
datafix, init.d, low storage
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Galaxy S I9000 Android Development by ThreadRank