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

Search This thread

Skroif

Senior Member
Nov 10, 2010
91
7
Borne
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 ?

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

This is what I get then...
524b708c-2f7a-61d8.jpg


Verstuurd van mijn GT-I9000 met Tapatalk
 

jifeng

Senior Member
Oct 12, 2010
117
8
Taipei
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 !

GREAT!! I learnt much from you, thanks.
 

jifeng

Senior Member
Oct 12, 2010
117
8
Taipei
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 !

Strange thing again~~
After applying DataFix_06042012 and reboot mobile, all data (incl. lib*) will be come back to /data/data (/datadata).
But all lib* still were remained on /data/local/staticdatadata/, but no link to /data/data/.
Please take a look~
 
  • Like
Reactions: sin007

finnsonc

Senior Member
Nov 4, 2010
56
11
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 !

Thanks seems to be working great for me


Sent from my GT-I9000 using xda premium
 

finnsonc

Senior Member
Nov 4, 2010
56
11
Strange thing again~~
After applying DataFix_06042012 and reboot mobile, all data (incl. lib*) will be come back to /data/data (/datadata).
But all lib* still were remained on /data/local/staticdatadata/, but no link to /data/data/.
Please take a look~

Have you tried uninstalling a couple of apps? There might not be enough room on datadata to move back to

Sent from my GT-I9000 using xda premium
 

tiwag

Senior Member
Oct 15, 2010
382
113
Strange thing again~~
After applying DataFix_06042012 and reboot mobile, all data (incl. lib*) will be come back to /data/data (/datadata).
But all lib* still were remained on /data/local/staticdatadata/, but no link to /data/data/.
Please take a look~

Confirm that
All lib folders copied to /datadata and no room check before so script runs out of space during copying to /datadata.

5990ce47-d209-1414.jpg



This script is crap!
Need to investigate and write a working one myself.

Also there is a big difference on reporting free space on /datadata when using du or df commands.
5990ce47-d769-e0ee.jpg

anyone who knows why?

__
sent using recycled bits and bytes, tiwag
 
Last edited:

Skroif

Senior Member
Nov 10, 2010
91
7
Borne
where can I find in titanium backup option troubleshooting and follow the symbolic links.

Wysłano z GT-I9000

Open TB, go to preferences (left bottom button), go all the way down to settings for problems (or something like that, it's the last option) and then tick second option

Verstuurd van mijn GT-I9000 met Tapatalk
 

pntballer505

Senior Member
Feb 21, 2011
560
20
So all of the sudden TiBu is not working and is telling me
"Insufficient storage available." Is that part of this /datadata
problem, or something else?
 

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
Confirm that
All lib folders copied to /datadata and no room check before so script runs out of space during copying to /datadata.

This script is crap!
As your comment ... :mad:
Don't be so rude please, I spent time for this.
Need to investigate and write a working one myself.
You're welcome for this.

Also there is a big difference on reporting free space on /datadata when using du or df commands.
anyone who knows why?
Cause little files use not only space needed but a full cluster.


Strange thing again~~
After applying DataFix_06042012 and reboot mobile, all data (incl. lib*) will be come back to /data/data (/datadata).
But all lib* still were remained on /data/local/staticdatadata/, but no link to /data/data/.
Please take a look~
/data/data is still a symlink to /datadata.
Just check with "ls -al /data", you should se the ./data symlink. Same command "ls -la /datadata/oneappsdir" should show you a symlink "lib" pointing to /data/local/staticdata/oneappsdir/lib.

Oh I see what you mean. Happened to me too. Something isn't working quite right.
By the hell ! The free space check is not good. I forced it to be true on my Linux station to apply the script and have put a 1750000 limit instead of 175000 (one 0 difference). And don't remove it before uploading the datafix. My mistake. Sorry for that ... :(:(:(:(

Correct script is here : Datafix_08042012.

Could you post a screenshot for each command please ...
 
  • Like
Reactions: finnsonc

pntballer505

Senior Member
Feb 21, 2011
560
20
Well, I'm not sure if the script worked for me or not.
Regardless, the only app I can't install is TiBu(Due to space errors?!).
All the others work fine...

Edit: Nevermind problem solved. For anyone else having this issue:
In data/app/ delete com.keramidas.TitaniumBackup.odex.
 
Last edited:

finnsonc

Senior Member
Nov 4, 2010
56
11
So I just have a question. The cache grows on datadata with use right? Do I need to worry about clearing it for each app somehow are will it do it automatically? How would I go about cleaning it if I wanted to? I assume it's something that can just be deleted right?
 

Kagadar

Senior Member
Sep 22, 2010
64
54
Sydney, Australia
So I just have a question. The cache grows on datadata with use right? Do I need to worry about clearing it for each app somehow are will it do it automatically? How would I go about cleaning it if I wanted to? I assume it's something that can just be deleted right?

Without lib/libs being on datadata, you should have an ample amount of space. Most apps should prevent their cache from growing completely out of proportion, but the easiest way to clean it if you actually do run out of space would be to use titanium backup. It has an option for clearing an application's cache.

You can remove it from the command line
Code:
rm -R /datadata/*/cache/*
Just be careful trying this, if you make a mistake it may end up deleting something important.

You can also do this manually through "Manage apps" in system settings. Exact procedure will vary with the ROM you're using.
 
  • Like
Reactions: finnsonc

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