5,597,501 Members 31,749 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
naTrium
Old
(Last edited by naTrium; 27th March 2012 at 01:29 PM.)
#1  
Junior Member - OP
Thanks Meter 139
Posts: 9
Join Date: Feb 2007
Default [SCRIPT][CM7/9] /datadata/ low storage notification lagless fix - init.d script

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/3...ata-partition/
http://forum.xda-developers.com/show....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.
Attached Files
File Type: zip DataFix_11032012.zip - [Click for QR Code] (195.4 KB, 25298 views)
The Following 137 Users Say Thank You to naTrium For This Useful Post: [ Click to Expand ]
 
Mr Woolf
Old
#2  
Mr Woolf's Avatar
Senior Member
Thanks Meter 605
Posts: 2,455
Join Date: Sep 2010
Location: Yorkshire
LOL. I posted a request for exactly this script in the mintberry thread a few days ago!

Good work fella, Cheers.

Carbon 4.2, temasek kernel, philz recovery.

Don't say "Thanks", just hit the button - it keeps the threads clean.
 
sthomas38
Old
#3  
Senior Member
Thanks Meter 528
Posts: 686
Join Date: Feb 2012

 
DONATE TO ME
OMG yeah! Was waiting for something like that . Will give it a try next time I'll encounter this problem .

Thanks mate.
 
ryandabao
Old
#4  
ryandabao's Avatar
Senior Member
Thanks Meter 40
Posts: 199
Join Date: Jan 2012
Location: Iloilo
Just flashed it. Cheers!

Sent from my GT-I9000 using xda premium


GT-I9000
Rom: Tiramisu+ I.C.E. A.G.E. V.1.8
Kernel: Devil2_0.72 b
Smoothest - Lag Free ICS experience to date!

Hit Thanks If I Helped You.
 
Njcki
Old
#5  
Senior Member
Thanks Meter 41
Posts: 119
Join Date: Jun 2010
I had HUGE problems with Titanium Backup.
I lose all by backups some weeks ago because symlinked were corrupted after restore!
 
naTrium
Old
#6  
Junior Member - OP
Thanks Meter 139
Posts: 9
Join Date: Feb 2007
Quote:
Originally Posted by Njcki View Post
I had HUGE problems with Titanium Backup.
I lose all by backups some weeks ago because symlinked were corrupted after restore!
According to this post, you can now force TB to follow all symbolic links for backup and restore.
The Following User Says Thank You to naTrium For This Useful Post: [ Click to Expand ]
 
stfudude
Old
#7  
stfudude's Avatar
Senior Member
Thanks Meter 273
Posts: 956
Join Date: Aug 2010
Location: Egypt
what if i already moved all my apps data to sdcard? do i move it back to internal memory then flash the script, or just flash the script then move the data to internal memory? which is the correct way?
Galaxy S I9000 -given to dad-
Galaxy S II I9100 -mainboard died-
Galaxy S III I9300 -sold-
Nexus 7 3G -sold-
Nexus 7 2013 (flo) | Stock KOT49H rooted + faux kernel
Moto G dual sim (XT1033) | Stock Motorola Asia firmware, Android 4.4.2, not rooted | currently testing for hardware issues
Sign up for Dropbox with this link and we'll both get extra 0.5GB.
Sign up for Mediafire with this link and we'll both get extra 1GB.

I'm not sorry at all for my English, go read my name. LOL
 
Njcki
Old
#8  
Senior Member
Thanks Meter 41
Posts: 119
Join Date: Jun 2010
Quote:
Originally Posted by naTrium View Post
According to this post, you can now force TB to follow all symbolic links for backup and restore.
Thanks! I'll try
 
naTrium
Old
#9  
Junior Member - OP
Thanks Meter 139
Posts: 9
Join Date: Feb 2007
AFAIK, if you have moved your apps to the SD card using the regular method (Apps2SD), the script will still work. This is because there's always leftover data on the phone, which then points to /.android_secure/ on the sdcard.

This script only changes the location of some data, but it's transparent to the phone.

If you don't feel safe about it, a full nandroid backup will restore the system to whatever setup you have now. (it also backs up what's mounted on the sdcard)
 
revthanki
Old
(Last edited by revthanki; 11th March 2012 at 11:28 PM.)
#10  
revthanki's Avatar
Senior Member
Thanks Meter 145
Posts: 245
Join Date: Apr 2010
Well done! I knew I was never going to get round to this I'll close my old thread and redirect people here. Before I do so:

1) does the stock CM9 kernel support init.d scripts? If not stock kernel users will have to follow the manual method.

2) maybe it's worth putting a capitalised warning in your post to get people to set the option in Titanium Backup to follow all symbolic links

The Following User Says Thank You to revthanki For This Useful Post: [ Click to Expand ]
Tags
cm7, cm9, datadata, low storage, script
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes