• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[MOD][GUIDE][ROOT EXPLORER] Free up data space. Move Dalvik Cache to System.

Search This thread

rlorange

Senior Member
Nov 5, 2010
4,307
2,242
Melbourne
GuYWith a deodexed and de-bloated Samsung Rom we have 500mb plus of free space on System partition which is wasted space.

I just tried something to free up some space for shared data/sdcard partition by moving Dalvik Cache from /data to /system then creating a folder link back in data to keep original location settings.

Took 30 seconds and freed up 260mb! This is what you do:

1. Using root explorer or similar. Go to /Data.

2. Navigate to "Dalvik-Cache" directory. Long press on it and select "move".

3. Navigate back to root directory and then to /System.

4. Paste the directory you must select rw first top right hand corner. It will take a minute to copy.

5. Now long press on the moved Dalvik-Cache directory in /System and select "Link to this folder" option.

6. Navigate back to /Data and paste the link.

7. Done! You now have moved the Dalvik-Cache location to unused space on System partition and left a sym-linked directory so Android thinks nothing has changed!

Note!: If you wipe Dalvik Cache from recovery a new directory will be recreated in Data and your moved directory in System will no longer be used it will just sit in System taking up space.

AFTER A DALVIK CACHE WIPE FROM RECOVERY YOU MUST DELETE THE DIRECTORY YOU CREATED IN SYSTEM AS IT IS NO LONGER USED. SIMPLY REPEAT THE ABOVE STEPS TO ACTIVATE THE MOD AGAIN.

Good luck. A REAL Dev could you please turn this into a CMW zip with the reverse undo counterpart to be flashed before a Rom upgrade.

UPDATE: looking at the link posted by a helpful person below (thanks!) I think we need to make /system mount as rw for this to work. Please help develop this idea more if anyone can help thanks

Sent from my GT-I9300 using xda premium
 
Last edited:

rlorange

Senior Member
Nov 5, 2010
4,307
2,242
Melbourne
Is it work on cm10? I have over 1gb free on system partition

I'M not sure haven't used cm10 yet but it should do. Just discovered a Dalvik Cache wipe from recovery recreates the directory in Data to the MOD needs to be repeated after this... makes it very safe to try on cm10!

I'm hoping a real Dev can take this idea and bake it into to custom Rom's and find more data we can move to free up more space :)

Sent from my GT-I9300 using xda premium
 

rlorange

Senior Member
Nov 5, 2010
4,307
2,242
Melbourne
Hi,
Maybe it's possible to do this via init.d script? It will be more convenient.
It's possible via init.d script to move dalvik-cache to /cache for example... so...

Just a thought :D or simply move it to /cache.

EDIT:found this: http://petermolnar.eu/linux-tech-coding/how-to-move-dalvik-cache-to-system-partition-in-android/

Yeah should be possible. I think a CWM zip would be best along with an undo version. I now have /Data/app directory moved so before a Rom update or nandroid backup it will be necessary to undo the move. I'll see if I can work out how to do this. Hopefully someone could help out. I'M not code literate yet lol!

Sent from my GT-I9300 using xda premium
 

ykkfive

Inactive Recognized Developer
Jul 25, 2010
3,003
2,907
ykkfive.blogspot.com
if u wanna free up the /data partition, it is a good and proper way to move the dalvik-cache elsewhere. but IMHO, the /system partition is not a good place to move to since by design the system partition is not suppose to have any frequent or unnecessary read write and thus it is ro by default. the other reason is its importance since it is the core part of the system. you can afford to pay for a corrupted data or cache partition but not the system partition since as long as the system files are save the whole system can be rebuilt in case of data loss etc

i am not against this trick and i only want to tell you my opinions. so if possible i would recommend u to put the dalvik cache somewhere else like the cache partition
 

rlorange

Senior Member
Nov 5, 2010
4,307
2,242
Melbourne
if u wanna free up the /data partition, it is a good and proper way to move the dalvik-cache elsewhere. but IMHO, the /system partition is not a good place to move to since by design the system partition is not suppose to have any frequent or unnecessary read write and thus it is ro by default. the other reason is its importance since it is the core part of the system. you can afford to pay for a corrupted data or cache partition but not the system partition since as long as the system files are save the whole system can be rebuilt in case of data loss etc

i am not against this trick and i only want to tell you my opinions. so if possible i would recommend u to put the dalvik cache somewhere else like the cache partition

Yes I've discovered that it's prob not a good idea to leave System rw.... all that wasted space tho :)

Sent from my GT-I9300 using xda premium
 

ykkfive

Inactive Recognized Developer
Jul 25, 2010
3,003
2,907
ykkfive.blogspot.com
Yes I've discovered that it's prob not a good idea to leave System rw.... all that wasted space tho :)

Sent from my GT-I9300 using xda premium



u can resize the system partition, and then reassign the disk space freed up to other partitions
NOTE: this is risky and may brick your phone

if you r interested, you can get some more info in my blog posts (based on I9000)
Free more available disk space from NAND - PART I
Free more available disk space from NAND - PART II
freeNANDmod - get more space from NAND - PART III
freeNANDmod - get more space from NAND - PART IV
 
  • Like
Reactions: rlorange

vadonka

Senior Member
Jul 25, 2007
2,060
2,740
Debrecen
- symbolic linked dalvik-cache directory may cause issues in some application, use the bind mount instead of this
- titanium backup feature (integrate dalvik-cache to rom) is not mean what you think. it is not for moving dalvik-cache to the system partition

edit: i writed a script what can do exactly what we need.

auto check the dalvik-cache already moved to the cache directory, if yes bind mount the directory. if not, moved the cache then bind mount
you can adjust the cache and the data partition in the beginning of the file, dont touch anything else! default is defined for the SGS3
log file is /cache/dalvik_mover.log
after a full cache wipe the script will be move the dalvik cache after the next reboot

just unzip and put this file to the /system/etc/init.d/ folder
then set the permission to 0755
reboot

this script is not using the system partition, so no need to remount the system as r/w. its used the cache partition what have more free space anyway and always writeable.
and the bind mount method is compatible with everything.
 

Attachments

  • S90dalvik2cache.zip
    853 bytes · Views: 382
Last edited:

XxXPachaXxX

Senior Member
May 1, 2010
1,542
4,301
Naples
GuYWith a deodexed and de-bloated Samsung Rom we have 500mb plus of free space on System partition which is wasted space.

I just tried something to free up some space for shared data/sdcard partition by moving Dalvik Cache from /data to /system then creating a folder link back in data to keep original location settings.

Took 30 seconds and freed up 260mb! This is what you do:

1. Using root explorer or similar. Go to /Data.

2. Navigate to "Dalvik-Cache" directory. Long press on it and select "move".

3. Navigate back to root directory and then to /System.

4. Paste the directory you must select rw first top right hand corner. It will take a minute to copy.

5. Now long press on the moved Dalvik-Cache directory in /System and select "Link to this folder" option.

6. Navigate back to /Data and paste the link.

7. Done! You now have moved the Dalvik-Cache location to unused space on System partition and left a sym-linked directory so Android thinks nothing has changed!

Note!: If you wipe Dalvik Cache from recovery a new directory will be recreated in Data and your moved directory in System will no longer be used it will just sit in System taking up space.

AFTER A DALVIK CACHE WIPE FROM RECOVERY YOU MUST DELETE THE DIRECTORY YOU CREATED IN SYSTEM AS IT IS NO LONGER USED. SIMPLY REPEAT THE ABOVE STEPS TO ACTIVATE THE MOD AGAIN.

Good luck. A REAL Dev could you please turn this into a CMW zip with the reverse undo counterpart to be flashed before a Rom upgrade.

UPDATE: looking at the link posted by a helpful person below (thanks!) I think we need to make /system mount as rw for this to work. Please help develop this idea more if anyone can help thanks

Sent from my GT-I9300 using xda premium

Yes, to get this working you need a system mounted Always in r/w.
So i suggest you to move dalvik on cache partition.
And it's better to do the mod inside ramdisk
 

walter11av

Member
Jan 2, 2012
39
8
- symbolic linked dalvik-cache directory may cause issues in some application, use the bind mount instead of this
- titanium backup feature (integrate dalvik-cache to rom) is not mean what you think. it is not for moving dalvik-cache to the system partition

edit: i writed a script what can do exactly what we need.

auto check the dalvik-cache already moved to the cache directory, if yes bind mount the directory. if not, moved the cache then bind mount
you can adjust the cache and the data partition in the beginning of the file, dont touch anything else! default is defined for the SGS3
log file is /cache/dalvik_mover.log
after a full cache wipe the script will be move the dalvik cache after the next reboot

just unzip and put this file to the /system/etc/init.d/ folder
then set the permission to 0755
reboot

this script is not using the system partition, so no need to remount the system as r/w. its used the cache partition what have more free space anyway and always writeable.
and the bind mount method is compatible with everything.


thank you very much works perfect
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    GuYWith a deodexed and de-bloated Samsung Rom we have 500mb plus of free space on System partition which is wasted space.

    I just tried something to free up some space for shared data/sdcard partition by moving Dalvik Cache from /data to /system then creating a folder link back in data to keep original location settings.

    Took 30 seconds and freed up 260mb! This is what you do:

    1. Using root explorer or similar. Go to /Data.

    2. Navigate to "Dalvik-Cache" directory. Long press on it and select "move".

    3. Navigate back to root directory and then to /System.

    4. Paste the directory you must select rw first top right hand corner. It will take a minute to copy.

    5. Now long press on the moved Dalvik-Cache directory in /System and select "Link to this folder" option.

    6. Navigate back to /Data and paste the link.

    7. Done! You now have moved the Dalvik-Cache location to unused space on System partition and left a sym-linked directory so Android thinks nothing has changed!

    Note!: If you wipe Dalvik Cache from recovery a new directory will be recreated in Data and your moved directory in System will no longer be used it will just sit in System taking up space.

    AFTER A DALVIK CACHE WIPE FROM RECOVERY YOU MUST DELETE THE DIRECTORY YOU CREATED IN SYSTEM AS IT IS NO LONGER USED. SIMPLY REPEAT THE ABOVE STEPS TO ACTIVATE THE MOD AGAIN.

    Good luck. A REAL Dev could you please turn this into a CMW zip with the reverse undo counterpart to be flashed before a Rom upgrade.

    UPDATE: looking at the link posted by a helpful person below (thanks!) I think we need to make /system mount as rw for this to work. Please help develop this idea more if anyone can help thanks

    Sent from my GT-I9300 using xda premium
    5
    - symbolic linked dalvik-cache directory may cause issues in some application, use the bind mount instead of this
    - titanium backup feature (integrate dalvik-cache to rom) is not mean what you think. it is not for moving dalvik-cache to the system partition

    edit: i writed a script what can do exactly what we need.

    auto check the dalvik-cache already moved to the cache directory, if yes bind mount the directory. if not, moved the cache then bind mount
    you can adjust the cache and the data partition in the beginning of the file, dont touch anything else! default is defined for the SGS3
    log file is /cache/dalvik_mover.log
    after a full cache wipe the script will be move the dalvik cache after the next reboot

    just unzip and put this file to the /system/etc/init.d/ folder
    then set the permission to 0755
    reboot

    this script is not using the system partition, so no need to remount the system as r/w. its used the cache partition what have more free space anyway and always writeable.
    and the bind mount method is compatible with everything.
    2
    if u wanna free up the /data partition, it is a good and proper way to move the dalvik-cache elsewhere. but IMHO, the /system partition is not a good place to move to since by design the system partition is not suppose to have any frequent or unnecessary read write and thus it is ro by default. the other reason is its importance since it is the core part of the system. you can afford to pay for a corrupted data or cache partition but not the system partition since as long as the system files are save the whole system can be rebuilt in case of data loss etc

    i am not against this trick and i only want to tell you my opinions. so if possible i would recommend u to put the dalvik cache somewhere else like the cache partition
    1
    Is this similar to the function "Integrate sys Dalvik into ROM" from Titanium Backup?

    Yeah I guess it is but if you do it through titanium the Dalvik Cache files are put with their apk files so wipe Dalvik Cache in recovery no longer works... Not 100% sure this is right tho

    Sent from my GT-I9300 using xda premium
    1
    Yes I've discovered that it's prob not a good idea to leave System rw.... all that wasted space tho :)

    Sent from my GT-I9300 using xda premium



    u can resize the system partition, and then reassign the disk space freed up to other partitions
    NOTE: this is risky and may brick your phone

    if you r interested, you can get some more info in my blog posts (based on I9000)
    Free more available disk space from NAND - PART I
    Free more available disk space from NAND - PART II
    freeNANDmod - get more space from NAND - PART III
    freeNANDmod - get more space from NAND - PART IV