New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
ewingr
Old
#6661  
Senior Member
Thanks Meter 105
Posts: 1,774
Join Date: Dec 2007
Quote:
Originally Posted by GGXtreme View Post
I've found an alternative to moving apps to SD (mainly because this is not an option for me). I found the workaround here, so credit goes to those that came up with it and worked on it.

Here are the steps to implement the workaround, cleaned up a bit for CM9 use. Implement this workaround at your own risk. This may negatively impact the performance of your device, but the impact won't be as severe moving apps to your SD card or using only the 2GB partition for app data. *Some of your apps (such as your homescreen launcher) may lose user data after you complete these steps. If you have the Nook app installed, please uninstall it before starting and reinstall it afterward.* After re-entering the data and setting up my homescreens again, I haven't had any issues with data being lost or reset.
  1. Using a terminal emulator or adb shell, run the following commands to replace the symlink to the /datadata partition located on 2GB /data partition with the actual contents of /datadata (the last 3 lines won't run until you've entered all 3, hitting the enter key between each line):
    Code:
    su
    cp -a /datadata /data/data.new &&
    rm /data/data &&
    mv /data/data.new /data/data
    Reboot the device.
  2. Using a terminal emulator or adb shell, run the following commands to delete the contents of the /datadata partition:
    Code:
    su
    rm -r /datadata/*
    You may receive an error about a directory named "lost+found", but this is OK.
  3. Copy and paste the following script into a text editor and save it as a .txt file with any name onto your internal SD card. Do not save it as a .sh file or attempt to load it with Script Manager or place it in init.d. This script (copied from the original thread I mentioned above) will scan the app data on the 2GB /data partition and move the appropriate databases and files back to the faster but smaller partition, while leaving most of the larger files where they are:
    Code:
    #!/system/xbin/sh
    # move_data_to_yaffs.sh
    #
    # Move select subdirectories from the ext4 /data/data directory onto the
    # quicker yaffs /datadata directory and create symbolic links in their place.
    #
    #
    # This script is designed for Cyanogenmod 7.X on Samsung Galaxy S (tested
    # with Vibrant) for users who have moved their app data from /datadata back
    # to /data/data using a procedure like:
    #
    #       cp -a /datadata /data/data.new &&
    #       rm -f /data/data &&
    #       mv /data/data.new /data/data
    #
    # This script then moves select subdirectories from each app back onto the
    # faster yaffs filesystem.  It should improve app startup and runtime
    # interactivity.
    #
    # This script may be run multiple times and should be run after one or more
    # new apps are installed.  I just keep this script in /datadata and run it
    # whenever I need to from a terminal, but you can put it in /system/bin, or
    # someplace else, if you like.
    #
    # Background
    # On Samsung Galaxy S, cyanogenmod 7 creates a ~175MB yaffs partition which
    # holds all app data.  This partition is mounted at /datadata and the usual
    # location of this directory at /data/data is a symbolic link that points
    # to /datadata.
    #
    #       $ ls -l /data/data
    #       lrwxrwxrwx      1 system        system  9 Oct  8 19:34 /data/data -> /datadata
    #
    # The app apk itself does not reside here, but data created by the app resides
    # here, especially, the app's sqlite databases and user preference xml files.
    # The cyanogenmod developers did it this way to address the lag experienced on
    # the stock Galaxy S firmware.  But, this produces a problem.
    #
    # The /datadata partition is quite small and may be filled up quickly by an
    # app that caches a lot of data (g+ for example).  Once /datadata fills up,
    # apps will begin force closing since they will not be able to create any new
    # data on /datadata.  The ext4 /data partition, which is about 2GB, has plenty
    # of space free.  So, it is attractive to move /datadata onto this large
    # partition.  But then we have the lag problem again.  That's where this script
    # comes in.  It moves certain subdirectories from each app back onto the low
    # latency yaffs partition (mainly sqlite database files and xml config files)
    # and keeps the large cached files that an app may create or download on the
    # much larger 2GB ext4 partition.
    
    # Move these app subdirectories
    dirs_to_move='databases shared_prefs opera app_databases'
    
    # Skip these apps
    # Barnes & Nobles keeps a few processes running in the background *all-the-time*
    # for some reason.  If you move its databases while these are running,
    # then the app no longer works correctly, so skip it.
    # * You can clear its data (or maybe log out) which will stop these processes,
    # and then create the symbolic links by hand if you want.  Once you log in,
    # the new files will be created in /datadata and the app will work correctly.
    # The Amazon Kindle app and Google Books app do not have this problem.
    skip_apps='bn.ereader'
    
    datadata='/data/data'
    yaffs='/datadata'
    
    test -L "$datadata" && {
            echo 1>&2 "Error: <$datadata> is a symbolic link, aborting"
            exit 1
    }
    
    cd "$datadata" &&
    for app in *; do
            echo " $skip_apps " | grep " $app " && continue
            for d in $dirs_to_move; do
                    if [ ! -L "$app/$d" -a -d "$app/$d" ]; then
                            echo "Processing $app/$d..." &&
                            if [ -d "$yaffs/$app/$d" ]; then
                                    rm -r "$yaffs/$app/$d"
                            fi &&
                            tar -cf - "$app/$d" | tar -C "$yaffs" -xf - &&
                            rm -r "$app/$d" &&
                            ln -s "$yaffs/$app/$d" "$app/$d" &&
                            chmod 775 "$yaffs/$app" ||
                                    echo 1>&2 "Error: failed moving $app/$d"
                    fi
            done
    done
  4. Install the Scripter app from the Android market. You must use either Scripter or GScript for this script to run; it will fail if you use Script Manager or busybox sh to run it.
  5. Using an Android text editor (such as Jota Text Editor), open the text file you saved containing the script, long-press to Select All of the text and Copy the entire script onto the Android clipboard.
  6. Open Scripter. When you get a popup message, choose "Browse as root" and Allow the superuser prompt. Close the popup message and choose Create script. Name the script whatever you want (ie. 'App Data Optimizer') and long-press Paste the script you copied into the box labeled Commands. Hit Save.
  7. Tap your script in the Scripter app and hit yes when asked if you want to run the script. The script should run successfully (you can choose 'More Info' to check if there were any errors). Reboot your device.
    • It is recommended that you open Scripter and run this script after installing all of your apps, or after installing a lot of new apps.

This fix has solved my "low on space" problem and allowed me to install all of my usual apps (more than twice the number I was able to with the default setup) without taking the same performance hit as the other workarounds. I hope this helps those who were having the same problem. I personally think the Cyanogenmod team should implement an option like this in their ROM for those who are too restricted by the size of the oneNAND chip, but if not, I'm fine with this method.
How's this working out for folks? Should this work on any ICS Rom?
 
korockinout13
Old
#6662  
korockinout13's Avatar
Senior Member
Thanks Meter 418
Posts: 1,570
Join Date: Oct 2011
Quote:
Originally Posted by ewingr View Post
How's this working out for folks? Should this work on any ICS Rom?
That's the old version of datafix, and you are in the wrong thread.

Sent from my SGH-I897 using XDA
LG Nexus 4 16GB (AT&T) CM 10.1 + franco kernel
ASUS Nexus 7 32GB CM10.1 + franco kernel
T-mobile Samsung Galaxy S 4G (as mobile hotspot & media device) CM9
AT&T Samsung Galaxy SII i777 (sold)
AT&T Samsung Galaxy S Captivate i897 (sold)


All in One Guide for Samsung i897 Captivate, i9000 Galaxy S
Get extra space on Copy or Dropbox with a new account!
 
ewingr
Old
#6663  
Senior Member
Thanks Meter 105
Posts: 1,774
Join Date: Dec 2007
Quote:
Originally Posted by korockinout13 View Post
That's the old version of datafix, and you are in the wrong thread.

Sent from my SGH-I897 using XDA
Thanks for the reply, I apprecaite it.

Not sure why you tell me I'm in the wrong thread. The post I quoted is in this thread. If its because I'm not useing this ROM...sorry to have bothered you.
 
nygfan760
Old
#6664  
nygfan760's Avatar
Senior Member
Thanks Meter 1099
Posts: 2,130
Join Date: Feb 2011
Quote:
Originally Posted by ewingr View Post
Thanks for the reply, I apprecaite it.

Not sure why you tell me I'm in the wrong thread. The post I quoted is in this thread. If its because I'm not useing this ROM...sorry to have bothered you.
It is because there is a new CM9 thread for the newer nightly builds, these were just alphas from a while ago.
Slick Rom for the AT&T Optimus G: Try it!

Donate to me if you would like to
 
korockinout13
Old
#6665  
korockinout13's Avatar
Senior Member
Thanks Meter 418
Posts: 1,570
Join Date: Oct 2011
Quote:
Originally Posted by ewingr View Post
Thanks for the reply, I apprecaite it.

Not sure why you tell me I'm in the wrong thread. The post I quoted is in this thread. If its because I'm not useing this ROM...sorry to have bothered you.
Sorry about that... Maybe I should have explained better! Look a few posts above for a link to the CM9 thread.

Sent from my SGH-I897 using XDA
LG Nexus 4 16GB (AT&T) CM 10.1 + franco kernel
ASUS Nexus 7 32GB CM10.1 + franco kernel
T-mobile Samsung Galaxy S 4G (as mobile hotspot & media device) CM9
AT&T Samsung Galaxy SII i777 (sold)
AT&T Samsung Galaxy S Captivate i897 (sold)


All in One Guide for Samsung i897 Captivate, i9000 Galaxy S
Get extra space on Copy or Dropbox with a new account!
 
ewingr
Old
#6666  
Senior Member
Thanks Meter 105
Posts: 1,774
Join Date: Dec 2007
Thanks guys...
 
alessio9899
Old
#6667  
Member
Thanks Meter 1
Posts: 33
Join Date: Aug 2011
i tried to install last version of this rom for the first time using the instrucions in first page but after i click on istall from zip file and the istallation starts the phone says :"installation aborted" why? please help me
 
korockinout13
Old
#6668  
korockinout13's Avatar
Senior Member
Thanks Meter 418
Posts: 1,570
Join Date: Oct 2011
Use the new thread. It should be a few posts above

Sent from my SGH-I897
LG Nexus 4 16GB (AT&T) CM 10.1 + franco kernel
ASUS Nexus 7 32GB CM10.1 + franco kernel
T-mobile Samsung Galaxy S 4G (as mobile hotspot & media device) CM9
AT&T Samsung Galaxy SII i777 (sold)
AT&T Samsung Galaxy S Captivate i897 (sold)


All in One Guide for Samsung i897 Captivate, i9000 Galaxy S
Get extra space on Copy or Dropbox with a new account!

Tags
cm9, icecreamhackish, ics, smooth, teamhacksung