[Script]New "Low Storage" Notification fix

Search This thread

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
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?
Imho, apps that take a lot of space. But if they'll become laggy, then the only way is to let their cache on /datadata and clear it regularly (or to use another app : Firefox Beta is great).

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 ?
Like other users having problem it seems the datafix doesn't apply entirely. Don't know why but will check this now. You don't have lost anything. Just try runing the datafix manually (with an app like Scripter on Google Play). I'll put the script in first post soon.
Just a stupid question.
Why Samsung Roms dont need it ?
How works the solution of Samsung?
I don't know how they manage app'datas and this little 172Mo chip. And while their roms aren't open source we couldn't ... But the Low storage notification never appear in Samsung Rom.

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.
Future plan : make some support as it seems users have problem with this. :(
I thought about an application but I don't have any skill for that.

Something went wrong for me too :eek:
I wasn't previously using datafix,flashed it and checked my /datadata a very little time after reboot that was 128Mb free.Seemed a lot of free space comparing to the only-libs 2903 version.For the same initial configuration/apps installed i usually get about 88Mb of free space after flashing 2903.
Just a little while later i noticed a datadata folder in /datadata and free space was now 66Mb...I reboot and /datadata ended full.

Note:Users of Devil or MnIcs get after each boot a user.log (+ a .bak of the previous boot) that describe among others things init.d process,it could help to paste it here :)
:eek:
Did you try to run the script manually ? Do you still have these logs ?

Seems to work for me... but can someone tell me what the following folders are for and if I need them or if they're remnants of some past datafix?

/data/data.new
/data/data2

Thanks.
Seems to not work correctly. The /data/data.new is a temporary directory created to reverse and clean previous datafix. It should be deleted once the script apply.

My vote is that you SHOULD put up a donation button, I am happy to contribute to your coffee fund (so long as you don't drink Starbuck's ;-) But since you're French, you surely have better taste than that!)
Never try a Starbuck coffee ... and I won't :D
For the donation stuff, I don't know how to process so I look at this once everything would be fine with my work.

After upgrade to ver.0521 from 0329, I have the following problems:
1. There is a data.new folder, I wonder if it can be removed.
2. new installed apps haven't been moved to datadata
3. removed apps haven't been removed from datadata

I'm on cm9 0520 with devil 0.56 kernel, busybox updated to 1.20.

By the way, the scripts run well under scripts manager.
1. The script doesn't apply correctly at first launch.
2. & 3. you have to reboot the phone while the script runs at boot (or run it manually).

And one more. I wanted to move com.android.email to data/data completely and edited skip_apps.txt. But when I check datadata folder with Disk Usage app - com.android.email still remains there.
What have I done wrong?
Unfortunately, you have to edit the "skip_apps.txt" before runing the datafix. If the apps have been moved to /datadata the current script couldn't get it back on /data/data. Will improve this later.

Try using Script Manager to run the script manually.
+1

For those having problems, please tell me on which rom and with which kernel (and busybox) you apply the script. Thanks !
I put the script in first post : grab it on your sdcard and run it using Scripter or equivalent app and ask me if it runs fine or no (execute it twice at least).
 

Jose_Paramore

Senior Member
Oct 30, 2010
695
93
Torre Del Campo
Ok, it worked!
For user that cannot get this mod to work:
-Download Script manager.
-With root explorer (or any other program) extract the script from the .zip file
-Open Script Manager and run the script giving it root permissions and allowing it to run on boot.
And that's it! Now everytime you reboot the phone the script will run.
I've noticed the difference a lot, now my Galaxy S is a lot faster, and I do not have the low storage bug :cool:
I will see if I face problems with Google Chrome (although I think the stock browser is a lot better)
;)
EDIT: I'm running cm9 with Semaphore 1.2.0 kernel
 
Last edited:

basily

Senior Member
Think I've got it !

Are those having problem had a previous datafix applied ? If so the problem may be solved quickly. :)

Yes, I had the previous datafix applied. I have the data/data.new folder left over, and also what is data/data2 ?

I am running on a Captivate with Slim 3.6, stock kernel, with KagadarLinkFixer applied, because even though krarvind says busybox is properly linked, on my phone, it was not.

However, even though I have the leftover data/data2 folder, it otherwise seems to work. The only errors I get when I run the script with SManager is:
ls: *: No such file or directory
ls: *: No such file or directory
 

bassie1995

Senior Member
Jan 9, 2011
2,505
407
Delft
Why don't Samsung use it? They are not using /datadata, they are using the slower implementation of putting it in the larger /data partition (I think, correct me if I'm wrong).

Because not everyone's phone (only some people have this problem) can correctly handle this /datadata "hack", which makes the phone faster, Samsung has opted not to use it, but thereby they are also making the phone slower (well, not the phone itself, obviously, just the OS :p).

Anyhow, so what eventually happens is that a .txt file is written onto the SD Card?

EDIT: And can it also be used on GB? I don't think Froyo will be relevant to this :p.
 
Last edited:
  • Like
Reactions: Jose_Paramore

Jose_Paramore

Senior Member
Oct 30, 2010
695
93
Torre Del Campo
Why don't Samsung use it? They are not using /datadata, they are using the slower implementation of putting it in the larger /data partition (I think, correct me if I'm wrong).

Because not everyone's phone (only some people have this problem) can correctly handle this /datadata "hack", which makes the phone faster, Samsung has opted not to use it, but thereby they are also making the phone slower (well, not the phone itself, obviously, just the OS :p).

Anyhow, so what eventually happens is that a .txt file is written onto the SD Card?

EDIT: And can it also be used on GB? I don't think Froyo will be relevant to this :p.

It can be used on CM7/Miui gb rom, but not on a Samsung based rom.

Enviado desde mi GT-I9000 usando Tapatalk 2
 

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
in my case I hadn't applied any datafix in my phone before yours.
This one or the 2903 one ? I can't reproduce this. Could you ask me on which rom/kernel you are please ?
I'm on nightly CM9 with stock kernel.

Yes, I had the previous datafix applied. I have the data/data.new folder left over, and also what is data/data2 ?

I am running on a Captivate with Slim 3.6, stock kernel, with KagadarLinkFixer applied, because even though krarvind says busybox is properly linked, on my phone, it was not.

However, even though I have the leftover data/data2 folder, it otherwise seems to work. The only errors I get when I run the script with SManager is:
ls: *: No such file or directory
ls: *: No such file or directory
So /data/data.new is a temporary folder (should be removed after script is applied). The /data/data2 folder is used by CM based rom to store some apps cache. Yes like my own script do ... But this is made by a script in /sbin included in intramfs depending on kernel. So it's not possible for me to edit this /sbin file.
My datafix doesn't need a properly linked busybox as each command calls busybox directly (hope I do this right).
The "ls" error appears only 2 times or more ?

Why don't Samsung use it? They are not using /datadata, they are using the slower implementation of putting it in the larger /data partition (I think, correct me if I'm wrong).
I never said that they don't use it (I hope they use the hardware they put in their phone) but that I don't know how they use it.

Because not everyone's phone (only some people have this problem) can correctly handle this /datadata "hack", which makes the phone faster, Samsung has opted not to use it, but thereby they are also making the phone slower (well, not the phone itself, obviously, just the OS :p).

Anyhow, so what eventually happens is that a .txt file is written onto the SD Card?

EDIT: And can it also be used on GB? I don't think Froyo will be relevant to this :p.
App's datas are managed differently between Samsung and CM roms so this script is not designed to be used with Samsung roms (and it is irrelevant cause on Samsung roms there no "Low storage" problem).

PS : I definitly have to try this Slim rom ... Could you post the content of your /system/etc/init.d folder here please ?
 
  • Like
Reactions: upichie

bassie1995

Senior Member
Jan 9, 2011
2,505
407
Delft
I never said that they don't use it (I hope they use the hardware they put in their phone) but that I don't know how they use it.

App's datas are managed differently between Samsung and CM roms so this script is not designed to be used with Samsung roms (and it is irrelevant cause on Samsung roms there no "Low storage" problem).

From what I read, I gathered Samsung didn't use it (or not as much as CM does). Not quite sure anymore, though :).
 

Jose_Paramore

Senior Member
Oct 30, 2010
695
93
Torre Del Campo
This one or the 2903 one ? I can't reproduce this. Could you ask me on which rom/kernel you are please ?
I'm on nightly CM9 with stock kernel.

So /data/data.new is a temporary folder (should be removed after script is applied). The /data/data2 folder is used by CM based rom to store some apps cache. Yes like my own script do ... But this is made by a script in /sbin included in intramfs depending on kernel. So it's not possible for me to edit this /sbin file.
My datafix doesn't need a properly linked busybox as each command calls busybox directly (hope I do this right).
The "ls" error appears only 2 times or more ?

I never said that they don't use it (I hope they use the hardware they put in their phone) but that I don't know how they use it.

App's datas are managed differently between Samsung and CM roms so this script is not designed to be used with Samsung roms (and it is irrelevant cause on Samsung roms there no "Low storage" problem).

PS : I definitly have to try this Slim rom ... Could you post the content of your /system/etc/init.d folder here please ?

Cm9, Semaphore 1.2.0 kernel

Enviado desde mi GT-I9000 usando Tapatalk 2
 

Wendigogo

Senior Member
Jun 14, 2010
614
327
Lyon
Samsung Galaxy Note 20 Ultra
  • Like
Reactions: upichie

basily

Senior Member
bbabc1de-bc58-c215.jpg
The "ls" error appears only 2 times or more ?

Always exactly 2 times.
 

Jose_Paramore

Senior Member
Oct 30, 2010
695
93
Torre Del Campo
Hi Wendigogo, what would happen if my /datadata partition gets filled again...? I've got 86mb used/90mb free now on /datadata.

Enviado desde mi GT-I9000 usando Tapatalk 2
 

upichie

Senior Member
Nov 15, 2010
1,354
287
Hi Wendigogo, what would happen if my /datadata partition gets filled again...? I've got 86mb used/90mb free now on /datadata.

Enviado desde mi GT-I9000 usando Tapatalk 2

Previously it would break your device, but I'm not sure that still applies. Either way, Google "Aroma File Manager". That's a file manager for recovery. With it, if your /datadata fills and you can't boot, you can't go into recovery, run the file manager, and clear up space.
 
  • Like
Reactions: Jose_Paramore

Top Liked Posts

  • There are no posts matching your filters.
  • 124
    Here we go ! :D

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

    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 ! :D
    8
    Took me time to realise, was seeing my datadata about 15mb left then thought "hmm, don't forget your datafix" but kept forgetting and finally see that every time chrome gav me that cache reading error datadata got more space left.
    Kept wondering about this and finally saw someone saying Pawitp talked about this.
    I didn't found Pawitp's words or changelog stating it but that's it.
    It's about a week that i flash cm9 based rom with no wipe and still i have approximately between 15 to 25mb left even opening new apps.
    That's a good news but if I understand correctly, it "only" flush the apps'cache if space left on /datadata is under 10%.
    But what's happen when installing many apps with big libs (like Dice Player or so) ? I mean if no more cache is present and low free space left ?
    I think CM dev thought about this but I'm curious. If someone could point to the appropriate bug it should be great ! :laugh:

    Will there be any further development to the datafix script in the future? If not I recommend updating the original post with the latest test version.

    I don't think the script needs any more work doing to it myself. Only thing I can think of is a user interface to make moving cache & apps to /data/data easier.
    There is developpement of the test version (as I've got a lot of personnal work not really fast :angel: ). And there's (at least) 2 bugs in test version : first if installing with previous datafix and second if space separated directories exists ...
    Both corrected in current version. I think upload a new zip tomorrow including these fixes (and creation of default txt files in /data/local/datafix directory).

    Plus Zatta and I are working on big improvements. Stay tuned ! ;)
    6
    The execution window opens and states that permission is denied
    Do I have to set something else before running this script through Script Manager? :confused:
    I suppose you have to run it as root ...




    As promised a new test version attached here, only two fixes here :
    • Solved a problem that can occurs if coming from another datafix version
    • Improve installation script in zip file :
      -creation of default txt files
      -adding gmail and market cache in move_cache.txt if not present
    • Fix issue with space separated directories in datafix script

    Some others things to include/improve and the undo_datafix to finish.

    Have a nice (end of) day ! :D
    5
    now i cannot download from play store,first i had the low storage notification,i flashed the datafix..it was good after the flash,no lag n no problem...but from today i cannot download from play store,i checked datadata by root explorer,there were just 166KB of space left..then i flashed the datafix again,now i have 9MB of space left but still cannot download from play store...any clue what to do?
    This is a problem I see before. You need to add "com.android.providers.downloads" and "com.google.android.gm" in "move_cache.txt" as said before. The first app is for market cache (so if /datadata is full you can't install/upgrade anymore apps) and the second is for Gmail cache.

    For whatever reason I can't clear any app's cache anymore, besides going in and manually deleting files. Apps don't work, doing it via Android's Manage Apps doesn't work—hell, not even Titanium Backup works.

    This is annoying.
    This could be "forced" by an external rooted app I think :)D @Zatta )

    Hey Wendigogo, do you follow the discussion here (plus read some posts back)?

    An uhh, you are okay, aren't you? Sent you a small update per mail, looks like you didn't get it again?
    Thanks for point this. I could use another directory in /data/local. The best way is to use a directory in /sdcard to prevent factory reset removing config files and to permit users editing it kindly.

    I install you update but don't have time to try it for now (no datafix installed as I don't have time to play with my phone now so few apps installed) .

    I'll be busy for about 2 weeks (preparing exams). I'll try to give a shot (and to YPhoto suggestions too) before this.

    Thanks for answering in this thread to people having problems. :cool:
    5
    Ok, it worked!
    For user that cannot get this mod to work:
    -Download Script manager.
    -With root explorer (or any other program) extract the script from the .zip file
    -Open Script Manager and run the script giving it root permissions and allowing it to run on boot.
    And that's it! Now everytime you reboot the phone the script will run.
    I've noticed the difference a lot, now my Galaxy S is a lot faster, and I do not have the low storage bug :cool:
    I will see if I face problems with Google Chrome (although I think the stock browser is a lot better)
    ;)
    EDIT: I'm running cm9 with Semaphore 1.2.0 kernel