Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP naTrium

11th March 2012, 09:57 PM   |  #1  
OP Junior Member
Thanks Meter: 140
 
9 posts
Join Date:Joined: Feb 2007
More
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, 26799 views)
Last edited by naTrium; 27th March 2012 at 02:29 PM.
The Following 138 Users Say Thank You to naTrium For This Useful Post: [ View ]
11th March 2012, 10:00 PM   |  #2  
Mr Woolf's Avatar
Senior Member
Flag Cornishman stuck in Yorkshire
Thanks Meter: 784
 
2,824 posts
Join Date:Joined: Sep 2010
More
LOL. I posted a request for exactly this script in the mintberry thread a few days ago!

Good work fella, Cheers.
11th March 2012, 10:09 PM   |  #3  
Senior Member
Thanks Meter: 532
 
690 posts
Join Date:Joined: Feb 2012
Donate to Me
More
OMG yeah! Was waiting for something like that . Will give it a try next time I'll encounter this problem .

Thanks mate.
11th March 2012, 10:10 PM   |  #4  
ryandabao's Avatar
Senior Member
Flag Iloilo
Thanks Meter: 40
 
199 posts
Join Date:Joined: Jan 2012
More
Just flashed it. Cheers!

Sent from my GT-I9000 using xda premium
11th March 2012, 10:26 PM   |  #5  
Senior Member
Thanks Meter: 41
 
129 posts
Join Date:Joined: Jun 2010
I had HUGE problems with Titanium Backup.
I lose all by backups some weeks ago because symlinked were corrupted after restore!
11th March 2012, 10:40 PM   |  #6  
OP Junior Member
Thanks Meter: 140
 
9 posts
Join Date:Joined: Feb 2007
More
Quote:
Originally Posted by Njcki

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: [ View ]
11th March 2012, 11:04 PM   |  #7  
stfudude's Avatar
Senior Member
Flag Egypt
Thanks Meter: 304
 
1,030 posts
Join Date:Joined: Aug 2010
More
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?
11th March 2012, 11:52 PM   |  #8  
Senior Member
Thanks Meter: 41
 
129 posts
Join Date:Joined: Jun 2010
Quote:
Originally Posted by naTrium

According to this post, you can now force TB to follow all symbolic links for backup and restore.

Thanks! I'll try
11th March 2012, 11:57 PM   |  #9  
OP Junior Member
Thanks Meter: 140
 
9 posts
Join Date:Joined: Feb 2007
More
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)
12th March 2012, 12:25 AM   |  #10  
revthanki's Avatar
Senior Member
Thanks Meter: 166
 
267 posts
Join Date:Joined: 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
Last edited by revthanki; 12th March 2012 at 12:28 AM.

The Following User Says Thank You to revthanki For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
cm7, cm9, datadata, low storage, script
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes