5,597,261 Members 40,489 Now Online
XDA Developers Android and Mobile Development Forum

[Script]New "Low Storage" Notification fix

Tip us?
(Last edited by Wendigogo; 31st May 2012 at 01:02 PM.) Reason: Editing FAQ and adding a donation link ;)
Senior Member - OP
Thanks Meter 311
Posts: 518
Join Date: Jun 2010
Location: Lyon

Default [Script]New "Low Storage" Notification fix

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 :
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

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) :
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 !
The Following 125 Users Say Thank You to Wendigogo For This Useful Post: [ Click to Expand ]
Senior Member - OP
Thanks Meter 311
Posts: 518
Join Date: Jun 2010
Location: Lyon


(ten chars)
The Following 3 Users Say Thank You to Wendigogo For This Useful Post: [ Click to Expand ]
Senior Member
Thanks Meter 18
Posts: 105
Join Date: Dec 2010
Location: Dublin
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
Senior Member
Thanks Meter 368
Posts: 358
Join Date: Jul 2010
Location: GT

awesome using chrome was causing me FC every once in a while
Senior Member
Thanks Meter 149
Posts: 714
Join Date: Oct 2011

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?
(Last edited by BradleyR2010; 21st May 2012 at 09:57 PM.)
Senior Member
Thanks Meter 368
Posts: 358
Join Date: Jul 2010
Location: GT

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?
ImraanK's Avatar
Senior Member
Thanks Meter 31
Posts: 451
Join Date: Oct 2010
Location: Durban
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

Galaxy S3 Marble White
Senior Member
Thanks Meter 16
Posts: 147
Join Date: Sep 2010
Originally Posted by Wendigogo View Post

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?

Senior Member
Thanks Meter 94
Posts: 672
Join Date: 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
Jose_Paramore's Avatar
Senior Member
Thanks Meter 93
Posts: 663
Join Date: Oct 2010
Location: Torre Del Campo
I've flashed this and now my /datadata partition is empty...

Enviado desde mi GT-I9000 usando Tapatalk 2

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

Advanced Search
Display Modes