• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [Merit] [INFORMATION] Why moving /data/data to /dev doesn't work.

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
 
Thanks for the information value, I gave up on attempting to do that anyways. I'd rather not move it to the SD card I'll just leave it where it's meant to be.

With link2sd and dalivk cache 2 dev script on init.d I have more than enough space on my phone. Still using stock rom as well. I've thought about flashing anthony's kernel but I haven't really found the need yet.
 
Thanks for the information value, I gave up on attempting to do that anyways. I'd rather not move it to the SD card I'll just leave it where it's meant to be.

With link2sd and dalivk cache 2 dev script on init.d I have more than enough space on my phone. Still using stock rom as well. I've thought about flashing anthony's kernel but I haven't really found the need yet.

I suppose if there was an app you desperately needed that had an abnormal abundance of data, linking it to sd would be a viable and justifiable recourse. At least on an app by app basis. Provided that you had class 10 sd card and didn't mind a slight performance hit. I myself am still using stock rom as well and have made no modifications to the kernel as it seems to be undesirable.


Trying to move data to /dev for me was just really about greed lol. I have plenty of space thanks to link2sd and the dalvik move script. I just wanted to see if I could do it and the idea of saving another 10mb or so made me drool lol

The only kernel modification I am interested in is enabling swap which I hear offers some advantages. Although I haven't a clue if it's true or not. I don't like the idea of over clocking these phones. On a computer where there is a way to ensure proper cooling through extra fans or water cooling method, it makes sense. But these phones have no such ability, not to mention they are battery powered and a desktop computer is not. Besides that, they are low end hardware and I doubt they will take much punishment especially outside the tolerances they were meant to operate under. And in any event I haven't really noticed any sluggishness in the processor speed accept when dealing with a poorly coded app.
 
I was having problems with lag. I flushed Anthony's kernel & the phone runs so much better. I also get battery life. It only seems to work with two governors tho. On demand & performance work great but everything else I get random reboots. Random meaning I don't know what the cause is. The processor hangs out around 245 most of the time but goes up to 748/768 MHz when the is a demand. My phone temp stays around 98`F & it is sealed up pretty good in a plastic & case.
 
I suppose if there was an app you desperately needed that had an abnormal abundance of data, linking it to sd would be a viable and justifiable recourse. At least on an app by app basis. Provided that you had class 10 sd card and didn't mind a slight performance hit. I myself am still using stock rom as well and have made no modifications to the kernel as it seems to be undesirable.


Trying to move data to /dev for me was just really about greed lol. I have plenty of space thanks to link2sd and the dalvik move script. I just wanted to see if I could do it and the idea of saving another 10mb or so made me drool lol

The only kernel modification I am interested in is enabling swap which I hear offers some advantages. Although I haven't a clue if it's true or not. I don't like the idea of over clocking these phones. On a computer where there is a way to ensure proper cooling through extra fans or water cooling method, it makes sense. But these phones have no such ability, not to mention they are battery powered and a desktop computer is not. Besides that, they are low end hardware and I doubt they will take much punishment especially outside the tolerances they were meant to operate under. And in any event I haven't really noticed any sluggishness in the processor speed accept when dealing with a poorly coded app.
Yeah, if I ever come across the need I can just manually create links of /data/data to the ext2 partition of my SD card. For now though, I haven't ran into much of an issue with the need. I agree though, the only reason I was attempting to move the /data/data/ to /dev/data was out of pure greed. Lol. I'm also interested in the adding SWAP to the Merit. Haven't really researched much into it though.

I was having problems with lag. I flushed Anthony's kernel & the phone runs so much better. I also get battery life. It only seems to work with two governors tho. On demand & performance work great but everything else I get random reboots. Random meaning I don't know what the cause is. The processor hangs out around 245 most of the time but goes up to 748/768 MHz when the is a demand. My phone temp stays around 98`F & it is sealed up pretty good in a plastic & case.

Sorry, but I've never ran into an issue with my phone acting sluggish on a normal basis. Sure, sometimes I have to restart my phone to fix a slight lag issue but that's not very common at all. Infact, 90% of the time I have my phone under-clocked down to 320Mhz most of the day and the Governor set to Conservative. The only times I clock back to 600Mhz and Governor to OnDemand is when I feel the need of playing a game that requires it.
 
Back
Top Bottom