[SCRIPT][CM7/9] /datadata/ low storage notification lagless fix - init.d script

Search This thread

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
Yes, that one :eek:
In the top of my screen i have the symbol. I have 14 mb free on /datadata
So the script doesn't apply ...
Could you run the script through adb shell or terminal emulator (as root) : sh /system/etc/init.d/30datafix ?

I don't recall it but you have to have a kernel supporting init.d script ... Stock CM9 doesn't support this so you'll have to flash a modded one (Devil is a good choice imho).
 
  • Like
Reactions: Skroif

Skroif

Senior Member
Nov 10, 2010
91
7
Borne
So the script doesn't apply ...
Could you run the script through adb shell or terminal emulator (as root) : sh /system/etc/init.d/30datafix ?

I don't recall it but you have to have a kernel supporting init.d script ... Stock CM9 doesn't support this so you'll have to flash a modded one (Devil is a good choice imho).


I have no idea how adb or terminal emulator work:eek:
I have the latest Semaphore kernel (0.9.7). Shouldn't that support init.d script?
 

finnsonc

Senior Member
Nov 4, 2010
56
11
It seems the fix hadn't been applied. To be sure, check if /data/data is a symlink to /datadata (with "ls -al /data"). But you could read what's coming next ... :D



I've been working hard to make a new version of this datafix. It works the opposite as current datafix (as @Kagadar suggests it) : it only move to ext4 partition (default in /data/local/staticdatadata) selected subdirectories ( lib and libs by default but you could easily add subdirectories like cache (not recommended, lag problems) or so).
As everything has to be moved on /datadata before applying the datafix, it checks if avalaible space is sufficient and does nothing if not. So if a datafix is used (with lots of apps) it may warns and fails. You'll have to uninstall some apps (and/or clean cache etc.) to decrease size of /datadata in order to use this datafix. You could reinstall them once the datafix has been worked, using the script if you've got another lowspace-warning.
If there's enough space on /datadata, it reverts all previous datafix and apply this one.

You could find it here : DataFix_04042012.zip.

As always, make a nandroid backup before using this. Titanium Backup has to be configured correctly to follow symlink etc.

PS : As it works the opposite of others datafix, /data/data is still a symlink. So if you wanna use another datafix it may break your phone : if it doesn't follow symlinks when copying files it will (ie DataFix_11032012.zip ).

So this one worked fine for me the first time I ran it and moved everything around correctly. Then the second time I ran it and went into the new folder (in data/local) and deleted everything in it. it just said removing stale app resources on the output and ran through the entire folder. Oh and I tried it with a fresh install too and it did the same thing
 

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
I have no idea how adb or terminal emulator work:eek:
I have the latest Semaphore kernel (0.9.7). Shouldn't that support init.d script?
Install an app like "terminal emulator" from Google Play and run commands i gave you earlier.

So this one worked fine for me the first time I ran it and moved everything around correctly. Then the second time I ran it and went into the new folder (in data/local) and deleted everything in it. it just said removing stale app resources on the output and ran through the entire folder. Oh and I tried it with a fresh install too and it did the same thing
:eek:
I tried this with a fake directory and it worked ... I don't have the time to correct this part untill friday so I comment it and upload a V2 version : http://minus.com/mmqQqw0m3/2f.

It's not an important part of the datafix : it just check if some app has been uninstalled and remove undeleted parts if there's any. So once corrected everything will be clean at first run and untill that the datafix will be effective.

Sorry for the inconvenience. :eek:

EDIT : I recheck this part and don't find where the problem is. Will try it "in vivo" and not on a GNU/linux terminal ...
 
Last edited:
  • Like
Reactions: finnsonc

finnsonc

Senior Member
Nov 4, 2010
56
11
Install an app like "terminal emulator" from Google Play and run commands i gave you earlier.

:eek:
I tried this with a fake directory and it worked ... I don't have the time to correct this part untill friday so I comment it and upload a V2 version : http://minus.com/mmqQqw0m3/2f.

It's not an important part of the datafix : it just check if some app has been uninstalled and remove undeleted parts if there's any. So once corrected everything will be clean at first run and untill that the datafix will be effective.

Sorry for the inconvenience. :eek:

No problem, that's what backups are for haha. Thanks
 

pntballer505

Senior Member
Feb 21, 2011
560
20
I've looked around the thread, but can anyone
tell me the code to type into terminal in order
to see how much /datadata is filled.
 

ivanchin99

Senior Member
Aug 13, 2010
333
35
Hello, Im using DataFix_29032012. Performance has been great but I have a 22mb database file that is taking a chunk of space out of datadata. It is not a performance-intensive file so how do i move it to /data/data/? :eek:

Edit the 30_datafix and put in skip_apps='com.www.xxx' and then flash it via cmw again?
 

Skroif

Senior Member
Nov 10, 2010
91
7
Borne
So the script doesn't apply ...
Could you run the script through adb shell or terminal emulator (as root) : sh /system/etc/init.d/30datafix ?

I don't recall it but you have to have a kernel supporting init.d script ... Stock CM9 doesn't support this so you'll have to flash a modded one (Devil is a good choice imho).

a/local/bin:$PATH <
app_60@android:/ $ sh /system/etc/init.d/30datafix
sh: /system/etc/init.d/30datafix: Permission denied
127|app_60@android:/ $

I don't think things went right :confused: :D

Something i am doing wrong?
Verstuurd van mijn GT-I9000 met Tapatalk
 

fylim

Senior Member
Sep 29, 2007
689
72
Auckland
a/local/bin:$PATH <
app_60@android:/ $ sh /system/etc/init.d/30datafix
sh: /system/etc/init.d/30datafix: Permission denied
127|app_60@android:/ $

I don't think things went right :confused: :D

Something i am doing wrong?
Verstuurd van mijn GT-I9000 met Tapatalk

U need to run with root.

Type su <return>

before running the sh 30datafix

Sent from my SGH-I9000 using XDA
 

Skroif

Senior Member
Nov 10, 2010
91
7
Borne
U need to run with root.

Type su <return>

before running the sh 30datafix

Sent from my SGH-I9000 using XDA

9107e012-f2ef-d86a.jpg


That isn't right is it...:what:

Verstuurd van mijn GT-I9000 met Tapatalk
 

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
Hello, Im using DataFix_29032012. Performance has been great but I have a 22mb database file that is taking a chunk of space out of datadata. It is not a performance-intensive file so how do i move it to /data/data/? :eek:

Edit the 30_datafix and put in skip_apps='com.www.xxx' and then flash it via cmw again?
This should works (don't test that part by myself). But (one more time), why moving this to /data/data if there's enough space on /datadata ?

That isn't right is it... :what:
:confused:
Could you execute (as root, with "su") these commands :
Code:
df -h
ls -lha /data
ls -lha /data/data/com.* (only one screenshot will be sufficient).

I will try to fix the latest datafix today but not sure to have time for that today ...
 
  • Like
Reactions: Skroif

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
I found my mistake on previous datafix (04042012). :)

Not on cleaning part (that's why I didn't found any error there :D ) but on initialisation part (testing if this datafix is currently applied or not). The end of the first "if" test wasn't at the good place (I was too hasty) ... :(
So the first time datafix works fine but next it will fails. And I didn't test it twice ...

Sorry for the inconvenience. The corrected "reversed" datafix is here : DataFix_06042012.zip.

As it doesn't work like others datafix, you MUST read the initial post to use it correctly !
 

jifeng

Senior Member
Oct 12, 2010
117
8
Taipei
I found my mistake on previous datafix (04042012). :)

Not on cleaning part (that's why I didn't found any error there :D ) but on initialisation part (testing if this datafix is currently applied or not). The end of the first "if" test wasn't at the good place (I was too hasty) ... :(
So the first time datafix works fine but next it will fails. And I didn't test it twice ...

Sorry for the inconvenience. The corrected "reversed" datafix is here : DataFix_06042012.zip.

As it doesn't work like others datafix, you MUST read the initial post to use it correctly !

I read the latest script, it seems a bit strange.
If I apply any other earlier script (like DataFix_29032012), I will have lib* on /data/data and others on /datadata.
I see DataFix_06042012 only backup /data/data/*, but /datadata/*.
Please correct me if I'm wrong, BTW, thanks for your great job.
 

MisT.

Senior Member
Aug 8, 2011
190
13
Tried it, i did everything including the titanium backup linking,,, the notification is still there,,, is it because am running midnight bigmem kernel??...

Sent from my GT-I9000 using XDA
 

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
I read the latest script, it seems a bit strange.
If I apply any other earlier script (like DataFix_29032012), I will have lib* on /data/data and others on /datadata.
I see DataFix_06042012 only backup /data/data/*, but /datadata/*.
Please correct me if I'm wrong, BTW, thanks for your great job.
You're not wrong ... but you are. ;)
But if you look at the command used to backup files there's an "L" (cp -aL bla bla.backup) which means "follow symlinks". So this command copy all files including those pointed by symlinks. And there's two situations with /data/data and /datadata.

If no datafix used, /data/data is a symlink to /datadata and all files are on /datadata; if classic datafix used (including DataFix_29032012) /data/data is not a symlink to some subdirectories (/data/data/app/lib for exemple) are linked to /datadata subdirectories.
For each of them, the "cp -aL" follows symlink and backup everything. :D

PS : and if my latest datafix (DataFix_06042012) is used it should work too ... /data/data points to /datadata and some subdirectories goes to /data/local/etc. The "cp -aL" is a magic command !
 

Top Liked Posts

  • There are no posts matching your filters.
  • 137
    Hello fellow I9000 users.

    tl;dr - This fixes your low storage notification problems just by flashing it on CWM.

    Disclaimer
    First of all, I'd like to inform you that this post is a compilation of the work done by drafnel on the CyanogenMod forums, revthanki on the XDA-Developers forum, and as such I take little to no credit in it, as all I've done was ask for drafnel to help me in the cleanup code for me to put it in a flashable zip.

    Sources:
    http://forum.cyanogenmod.com/topic/39718-workaround-for-small-datadata-partition/
    http://xdaforums.com/showthread.php?t=1444333

    Also, as you should know, you take full responsability should data loss or other kinds of damage occur.

    Introduction
    Lot's of people have encountered the problem where their /datadata partition fills up and then apps begin force closing. This is often confusing since there is usually a lot of space available on the internal 2GB storage partition. But these are two different partitions on cyanogenmod. The created the datadata partition on the fast internal memory so that apps would start up and run faster (i.e. less lag), but it is only about 170MB (which can't be helped).

    One thing that can be done is to move the contents of /datadata onto the 2GB /data partition. That will solve the space problem, but then you have the lag problem. So, what we need is for the files that take up a lot of space to reside on the 2GB partition and the files that are accessed frequently by an app to reside an the fast 170MB partition. The files that are accessed often, or that affect app startup speed are the sqlite database files and the xml preferences files. These reside in the databases and shared_prefs sub-directories in each app directory. Drafnel has written a script to perform these operations.

    Requirements
    • Samsung Galaxy S based phone (GT-I9000, Vibrant, Fascinate, Captivate, etc.)
    • Kernel that supports init.d scripts

    How to use it?
    As you would flash a ROM update or a Kernel:
    1. Download the file to your sdcard.
    2. Reboot your phone into CWM.
    3. Choose 'install zip from sdcard', and choose the script from there.
    It will run on boot everytime. It's pretty light so your total boot time shouldn't suffer. It will only do the operations if they are needed, and it will clean up after itself. No need to worry about broken links or stale resources.


    What it actually does?
    On every boot:
    1. Runs a check to see if /data/data is still symlinked to /datadata/
    2. Moves everything that isn't performance critical from /datadata/ to unlinked /data/data/
    3. Cleans up old databases from uninstalled apps

    Other stuff to watch out for
    • Titanium Backup users should tick the Preferences > Troubleshooting settings > Follow all symbolic links option
    • SlimICS users should follow this procedure

    Changelog
    11032012 - First working release.
    11
    For those of you who are having trouble getting the script to run, I have created a small flashable zip that will ensure that the missing busybox applets are symlinked. For whatever reason SlimICS doesn't have busybox linked properly.

    TL;DR - Flash if on SlimICS
    9
    I get rm failed for -rf when I manually run the script. Any ideas? I'm on a Samsung captivate and cm9.
    Just remove the "f" from each "rm" command.
    But it seems you're using the April script which is not recommended and buggy.

    I'm working on a "next generation" script running flawlessly since 3 days. Like the 2903 datafix libs are on /data and everything else is on /datadata. But now, you could move selected applications cache (like Chrome or so) to /data. And this could be reverted ;-)
    I have to test this when updating rom then create a new topic here. :p.

    Sent from my GT-I9000 using XDA
    6
    Please help me working datafix for slim ics 3.4 with devil kernel 2_0.74 thanks....
    Has anyone got this to work on AOKP build 33 yet? And if so, which kernel are you on, which version of this script did you use and exactly how did you install it?
    Actually, make that build 34 since I'm currently looking at the bug fixes that one introduces and I'm probably going to update now...
    Did you try to rename the /system/etc/init.d/30datafix to /system/etc/init.d/S30datafix ????

    I think I should make another zip file with this mod ...


    EDIT : done DataFix_29032012v2.zip
    6
    Does this script move the cache to /data/data aswell, or does it stay in /datadata?

    I hope it does as it's annoying having to delete the cache all the time.
    As some apps lag if their cache wasn't on /datadata you could choose (by editing a text file) which apps store their cache on /data. This could be reverted if app becomes laggy ...

    EDIT : Here is my new datafix : http://xdaforums.com/showthread.php?t=1665742