valueforvalue
Well-Known Member
Ok for anyone trying to do this, I can tell you why it will not work.
I finally had time to tinker with it and managed to figure out what is going on.
Ok here goes when you create a folder on /dev let's say /data for instance once you reboot that folder will be deleted. Android deletes it so upon restarting your data will be either gone or for semi intelligent apps simply reset. Which I what gives the appearance of a data reset on all the apps you moved.
I experimented with a live phone on two different apps, copying the data from /data/data to /dev is easy, but once you remove the actual data from /data/data so that you can create a link your done. The apps will function perfectly provided you use cp -rp and you will have a nice space gain but, as soon as you reboot all that data will be cleared from /dev and for the apps that are smart they will just reset to default other apps will cease to function altogether.
The simple answer to this is that there is simply no way of preserving the data on /dev so that it will be there upon the next reboot. That's why all of the scripts copy and link data to the sd because it's preserved on reboot. So for everyone trying this might as well hang it up, if you want data moved just move it to the sd card and link it. There are performance issues with that though so just keep it in mind.
The only way I know of to fix this problem would be to most likely edit the init.rc script or some other file in the boot image. Whatever is responsible for clearing /dev. I'm sure that would have implications of its own. The reason that moving the dalvik cache to /dev works is because it is rebuilt if it needs to be on reboot. So when android clears /dev it just rebuilds the cache and links it again no worries there. I will post a link to the script I made to test this out in case anyone is interested, just know that whatever app you try it on will get its data reset or will give you issues. This script is not meant to be used with init.d its only meant as a test on a live phone. You can edit it to work with init.d easy but it won't do you any good. It's mainly just to illustrate how to do a proper copy of the data and link.
All you need to do to test it on one of your apps is to change com.quoord.lawGuide to the name of one of the app folders in your /data/data law guide was my test subject because it has about 5mb worth of data. Note this script could have been written with a variable to make it smaller and less to change but I just wrote it real quick as a test anyway.
http://www.sendspace.com/file/5jdecr
I finally had time to tinker with it and managed to figure out what is going on.
Ok here goes when you create a folder on /dev let's say /data for instance once you reboot that folder will be deleted. Android deletes it so upon restarting your data will be either gone or for semi intelligent apps simply reset. Which I what gives the appearance of a data reset on all the apps you moved.
I experimented with a live phone on two different apps, copying the data from /data/data to /dev is easy, but once you remove the actual data from /data/data so that you can create a link your done. The apps will function perfectly provided you use cp -rp and you will have a nice space gain but, as soon as you reboot all that data will be cleared from /dev and for the apps that are smart they will just reset to default other apps will cease to function altogether.
The simple answer to this is that there is simply no way of preserving the data on /dev so that it will be there upon the next reboot. That's why all of the scripts copy and link data to the sd because it's preserved on reboot. So for everyone trying this might as well hang it up, if you want data moved just move it to the sd card and link it. There are performance issues with that though so just keep it in mind.
The only way I know of to fix this problem would be to most likely edit the init.rc script or some other file in the boot image. Whatever is responsible for clearing /dev. I'm sure that would have implications of its own. The reason that moving the dalvik cache to /dev works is because it is rebuilt if it needs to be on reboot. So when android clears /dev it just rebuilds the cache and links it again no worries there. I will post a link to the script I made to test this out in case anyone is interested, just know that whatever app you try it on will get its data reset or will give you issues. This script is not meant to be used with init.d its only meant as a test on a live phone. You can edit it to work with init.d easy but it won't do you any good. It's mainly just to illustrate how to do a proper copy of the data and link.
All you need to do to test it on one of your apps is to change com.quoord.lawGuide to the name of one of the app folders in your /data/data law guide was my test subject because it has about 5mb worth of data. Note this script could have been written with a variable to make it smaller and less to change but I just wrote it real quick as a test anyway.
http://www.sendspace.com/file/5jdecr