Jump to content

[GUIDE] How to get more FREE SPACE for your apps


Guest ztedd

Recommended Posts

what's included in this guide (updated 2011-02-17 01:19):

#!/system/bin/sh

#

#


#### START - Redirect cache partition to /data ####

mkdir /data/cache

chown system.cache /data/cache

chmod 770 /data/cache

mkdir /data/cache/recovery

chown system.cache /data/cache/recovery

chmod 770 /data/cache/recovery

mkdir /data/cache/lost+found

chown root.root /data/cache/lost+found

chmod 770 /data/cache/lost+found

umount /cache

rmdir /cache

ln -s /data/cache /cache

#### END - Redirect cache partition to /data ####

After creating the file (using adb push or Rootexplorer), make sure to get the script file executable - open terminal and execute these commands:

- If you use Japanese Jellyfish or any other ROM that loads userscripts from /system/bin/userinit.sh then you have to insert the above code in that file (only the code starting with "#### START - Redirect cache").

Insert it at the end of the file but before the following line:

"/system/bin/setprop userinit.filesystem.ready 1" (if existing).

- You can also add the code to /system/etc/init.qcom.post_boot.sh it should work with most roms using that file.

- Alternatively you can redirect the cache to RAM. This possibly speeds up market installs a little bit. Instructions here.

--------------------------------------------------------

C A2SD+ - moving data or dalvik-cache to sd card:

(root needed or a custom ROM with A2SD+ support)

Only recommended if you dont't have enough space after finishing steps A (A2SD) and B (changing partition sizes)

The last possibility is to move either /dalvik-cache or the /data/data dir to your sd card. Be careful! I don't recommend that in general because your system possibly will be slower because the SD card is supposed to be much slower than the ROM drive.

The dalvik cache will be accessed every time an app starts, it will transfer the compiled files from the cache to the memory. So the start of an app will be slower perhaps but then it's okay (however as we know, android often terminates or pauses apps in background and they are "silently restartet" if you switch to them again, so also this will be slower).

The /data/data/ dir will be accessed by the apps, e.g. browser cache. So it depends on the app if it will be slower because of the moved folder.

How to move the data folder or dalvik-cache:

Sometimes this is also described by the term "A2SD+". Some Custom ROMs support it (e.g. MoDaCo Custom Froyo, according to the comparison table). So if you use MoDaCo Custom Froyo and have A2SD enabled (by having created the ext2 partition on the sd card as explained in section A), then also the dalvik-cache will be moved to the sd card.

However you also can do it by yourself if you already have A2SD enabled (this is necessary, as well as root access).

start the terminal and type (without |):

in order to move /data/data:

| su

| cp -pr /data/data /system/sd

| rm -r /data/data

| ln -s /system/sd/data /data/data

Be careful! you will loose all your application data if this fails. however usually the default data can be restored by android using the .apk file. I recommend creating a Titanium Backup before doing this (as well as an nandroid backup).

and in order to move dalvik-cache:

| su

| cp -pr /data/dalvik-cache /system/sd

| rm -r /data/dalvik-cache

| ln -s /system/sd/dalvik-cache /data/dalvik-cache

If the dalvik-cache should get lost, it's not such a problem because it will be easily recreated on reboot (taking some minutes the first time). However, the dir /data/dalvik-cache should exist and be accessible for the system (or the according symlinked dir).

Caution! If you do this, most of the apps or even the whole system won't work if the whole SD card is ejected / unmounted!

Edited by ztedd
Link to comment
Share on other sites

Guest Phoenix Silver

wow amazing work

ty ;)

my config is :

fat 32 part 1.5 gigs

ext3 part 512 megs

a2sd a2sd+

dalvik cache moved to sd card in ext3 part

works fine until now

Link to comment
Share on other sites

dalvik cache moved to sd card in ext3 part

works fine until now

how did you move the dalvik-cache (using some boot script or just move + symlink)?

did you notice any performance difference to having the dalvik-cache on the ROM drive?

perhaps someone could use a stopwatch to compare the time needed to start a certain bigger app - once having the dalvik-cache on the ROM and once on SD.

(the app should be killed - then start the app again and stop the time)

Edited by ztedd
Link to comment
Share on other sites

Added some notes on the right version of Clockworkmod, choosing of filesystem (ext2 vs. ext3, perhaps can be more elaborated) and getting to know the free space of the different mounts.

--

Has anyone yet compared the general performance of (the starting of) apps having /data/data or /data/dalvik-cache either on the internal flash memory or moved to sd card?

Link to comment
Share on other sites

Added clearification on how to check the free space in the different directories / partitions.

you can see if A2SD is working if you browse to /system/sd folder (for that you need root access. Use the app Rootexplorer, terminal or adb) and check if there is something inside. /system/sd is the ext2 partition on your sd card.

Alternatively (also without root possible) do this to have a look on the free space of the different directories:

open terminal or adb shell and type "busybox df -h". If there are too many lines, type: "busybox df -h | head". If you don't have busybox installed, just type: "df".

Link to comment
Share on other sites

Added overview, explanating the most relevant terms:

  • App2SD / Move2SD - feature officially included in Android 2.2 (Froyo) (no root necessary), some apps can be partially moved to SD card, i.e. *.apks are moved to /sdcard/.android-secure (on fat32 partition). Can be done using android settings - apps - ... - move to SD card or using the app "Apps 2 SD". Normally only works with apps supporting the feature and needs to be done manually, but with the app "Move2SD Enabler" (root only) it's possible for all apps and automatically. Has the disadvantage that moved apps won't work if SD card is mounted to the PC connecting the phone by USB or if the SD card is removed.
  • A2SD - feature included in most of the new Custom ROMs (see comparison table). Moves *.apks to SD card similar to App2SD, but works automatically and apps even work if the SD card is mounted to the PC connecting the phone by USB (and many apps even work if the sd card is temporally removed after boot). Moves the apks to the ext2 partition of the sd card instead to the fat32 partition as App2SD does. Therefore partitioning of the SD card is needed, it can be done using Clockworkmod or with partitioning software.
  • A2SD+ - feature so far included in MoDaCo Custom Froyo Beta11 and can be installed manually if A2SD is working already and if you have root access. Does not only move the *.apks to ext2 on SD card, but also the dalvik-cache or data folder, depending on what you decide to move. Is supposed to possibly slow down apps or system, but there are not enough experiences yet to clearly state the extent of that. Notably increases read/write to SD card so potentially reduces card life (as system and apps are accessing SD card for dalvik-cache while starting and accessing the data folder while running).
  • changing partition sizes - feature included in some Custom ROMs using the TPT install method (e.g. Japanese Jellyfish RLS9), but is also able to be done with every other ROM, including Stock ROMs, no root necessary. Will change the size of the internal ROM /system and /cache partitions, removing unused (and unnecessary) free space from them to give the /data partition more free space. You can get up to 330 MB space for your /data partition!

Link to comment
Share on other sites

Guest Ice-berg

Hello. I am doing everything according to the instructions (I have an A2SD) and after entering the command:

rm -r/data/data

I have:

rm filed for -r/data/data, No such file or directory

I do not understand, because I have ext partitions and install applications on it(I have folders system/sd/app and app-private

Is there something I'm doing wrong?

Link to comment
Share on other sites

Is there something I'm doing wrong?
Yes, there seems to be a space missing in your command.

It should be "rm -r /data/data" instead of "rm -r/data/data".

Caution: Only delete /data/data after you already have succesfully copied this dir to /system/sd/data and checked if the content arrived there and after you have made a backup (Titanium, nandroid, or both).

Link to comment
Share on other sites

Guest Ice-berg

Actually, my mistake. Thanks for the information.

But I have another problem, Ive done it again, this time it all worked out.

I had over 128MB. free space on internal memory after I did it(before I was about 85MB.). But as I turned off the phone and turned on again after a while everything returned to the situation which was before modification. Internal memory has returned to earlier 85MB. I do not have a folder system/sd/data ?

Link to comment
Share on other sites

are you sure that A2SD is working and the copying really succeeded?

I guess that the folder wasn't copied correctly.

And after copying the old folder has to be deleted and then replaced by the symlink pointing to the new folder.

So check if the commands worked after each command.

Which rom do you use btw?

Link to comment
Share on other sites

updated instructions how to move /cache:

Note: the /cache partition is only needed for downloads from the market. If you want to download an app bigger than 4.5 MB, you will have to move the /cache directory to /data.

For this you can use the following cache redirect script:

The install procedure is slightly different depending on which ROM you use.

- If you use FLB-Froyo or any other ROM that loads userscripts from /etc/init.d/ then create the file:

/etc/init.d/80redirectcache with the following code:

#!/system/bin/sh

#

#


#### START - Redirect cache partition to /data ####

mkdir /data/cache

chown system.cache /data/cache

chmod 770 /data/cache

mkdir /data/cache/recovery

chown system.cache /data/cache/recovery

chmod 770 /data/cache/recovery

mkdir /data/cache/lost+found

chown root.root /data/cache/lost+found

chmod 770 /data/cache/lost+found

umount /cache

rmdir /cache

ln -s /data/cache /cache

#### END - Redirect cache partition to /data ####

After creating the file (using adb push or Rootexplorer), make sure to get the script file executable - open terminal and execute these commands:

- If you use Japanese Jellyfish or any other ROM that loads userscripts from /system/bin/userinit.sh then you have to insert the above code in that file (only the code starting with "#### START - Redirect cache").

Insert it at the end of the file but before the following line:

"/system/bin/setprop userinit.filesystem.ready 1" (if existing).

Edited by ztedd
Link to comment
Share on other sites

You can also add those /cache redirection lines to /system/etc/init.qcom.post_boot.sh it should work with more roms using that file.

Edited by wbaw
Link to comment
Share on other sites

Thanks wbaw, I updated the guide to include that.

You also suggested to move /cache to RAM. For that, one should use the following code for redirecting the cache (instead the above posted code):

#### START - mount /cache as tmpfs ####

umount /cache

mount -t tmpfs -o size=42M,nr_inodes=42k,mode=0770 tmpfs /cache

chown system.cache /cache

#### END - mount /cache as tmpfs ####

As every tmpfs, it will store the /cache files in RAM, only using as much RAM as temporarily necessary. So if 5 MB of cache are used, only 5 MB of RAM will be used (even if the /cache tmpfs partition is 42 MB).

I'm not sure how much it will be speed up market app installations. Probably not very much if the internet speed isn't higher than the internal ROM speed. Some testing with stop watch would be necessary to tell that by sure...

Edited by ztedd
Link to comment
Share on other sites

Guest prasad_den

I use JJ9 on my San Francisco, and it supports A2SD by default. Now, I did the SD card partitioning (following this guide) only yesterday. How can I ensure that the apps I had installed prior to the partitioning are also moved to the card? Or does it occur automatically. As of now, there seems to be no change in the internal memory.

Link to comment
Share on other sites

I use JJ9 on my San Francisco, and it supports A2SD by default. Now, I did the SD card partitioning (following this guide) only yesterday. How can I ensure that the apps I had installed prior to the partitioning are also moved to the card? Or does it occur automatically. As of now, there seems to be no change in the internal memory.

I'm interested in the answer to this one too :D

Link to comment
Share on other sites

I use JJ9 on my San Francisco, and it supports A2SD by default. Now, I did the SD card partitioning (following this guide) only yesterday. How can I ensure that the apps I had installed prior to the partitioning are also moved to the card? Or does it occur automatically. As of now, there seems to be no change in the internal memory.
Normally if your ROM supports A2SD and it detects an ext2 partition on SD, then it should copy everything from /data/app to /system/sd/app and then symlink it and delete the old /data/app dir. So it should work with the ROM`s A2SD script.

Are you sure it worked like that? Check if there is the symlink /data/app (directing to /system/sd/app) instead of the directory /data/app.

You might also try to move the apps to SD card using APP2SD, then move them back to "internal" which in fact will move them to A2SD partition.

Link to comment
Share on other sites

Guest mouseman99

ok guys. require some assistance on this please.

I have followed these guidelines tonight and also at the same time have changed to FLB r9 rom. I done a titanium backup before installing ROM and also copies my old contents of the SD card over to my PC (I have since copied backl). Rom has been installed fine and a2sd seems to be ok as well (Titanium backup shows a2sd at the bottom (but with only 10mb used)

I am however missing all my apps. I can see them in Titanium Backup but when I restore it runs through the batch but the apps dont appear back in the app drawer. Is there something I am doing wrong????

Hope someone can help

Link to comment
Share on other sites

Guest PrettyPistol555

AWESOME Guide!!!!!

can this be done on other android devices as well, or is it unique to ZTE Blade?

I'm particularly wondering about nexus one, as i have a lot of system cache that is unused, but running out of space for apps.

if there is a guide elsewhere that i should be aware of please link, i searched Modaco AND google, and found nothing about re-sizing these partitions.

THANKS. :huh:

Link to comment
Share on other sites

Not working for me ... sorry.

got an HTC Desire with Modaco R9 installed.

Did the partitioning size thing. I have a folder "image" on my SD-Card, containing almost all the files details (I have no recovery.img file in my nand backup folder. I do have an md5 file there too).

Rebooted the phone with Vol UP, nothing happened. Rebooted with Vol UP + Menu pressed - restarted in safe mode but htat's it. No green message of "updating" no nothing.

Anyone ?

Link to comment
Share on other sites

Thanks wbaw, I updated the guide to include that.

<a name="cache_in_ram"></a>You also suggested to move /cache to RAM. For that, one should use the following code for redirecting the cache (instead the above posted code):

#### START - mount /cache as tmpfs ####

umount /cache

mount -t tmpfs -o size=42M,nr_inodes=42k,mode=0770 tmpfs /cache

chown system.cache /cache

#### END - mount /cache as tmpfs ####

As every tmpfs, it will store the /cache files in RAM, only using as much RAM as temporarily necessary. So if 5 MB of cache are used, only 5 MB of RAM will be used (even if the /cache tmpfs partition is 42 MB).

I'm not sure how much it will be speed up market app installations. Probably not very much if the internet speed isn't higher than the internal ROM speed. Some testing with stop watch would be necessary to tell that by sure...

I did this and it worked, but every time I reboot the change is gone and my cache comes back to 4.5 MB (I use 128 MB system, 4.5 MB cache, 324 MB data partitioning). Shouldn't this cache-to-ram be permanent? I use FLB 9b, Blade LCD, 5 MP.

Link to comment
Share on other sites

Not working for me ... sorry.

got an HTC Desire with Modaco R9 installed.

Did the partitioning size thing. I have a folder "image" on my SD-Card, containing almost all the files details (I have no recovery.img file in my nand backup folder. I do have an md5 file there too).

Rebooted the phone with Vol UP, nothing happened. Rebooted with Vol UP + Menu pressed - restarted in safe mode but htat's it. No green message of "updating" no nothing.

Anyone ?

Try doing it on a ZTE Blade or Orange San Francisco, rather than a HTC Desire.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.