[Script][4.2.x] Move /sdcard app data to /extSdCard (Wip) [updated 7th Mar]
What is this?
This is a script that will allow you (with your 4.2.x ROM) to bind the data from any app or game from /sdcard/Android/data to extSdCard. This means, your internal memory is no longer being filled by 6 Games (and their respective data) on the 16 GB versions of the S3.
Hasn't this been done before?
Yes and no. Back in the 4.0.4, 4.1.1 and 4.1.2 days, we could all use an app called "Directory Bind" but this no longer works in 4.2.x because Google have changed the way this works (Permissions). What happens now, is only the app that creates the bind can see it. For example, if you bind one directory to another using terminal, if you cd to the original location, do an "ls" list command and it will list you the data in the new location. However, browse to the original location in a file manager, it will be empty.
So this script works?
Yes it does. It uses what is unfortunately an "ugly" work around, by hijacking a system processes (debugger daemon) to achieve elevated permissions (Above and beyond that of su).
The script is still very much a "Work in Progress". I would even call it a proof-of-concept at this point. It will be tidied up and made more user friendly as time goes on. Right now though, I'm just happy to have it working.
Is this the only way?
No it is not. There are ways of changing the Dalvik cache or patching init.rc and various other technical methods that have found their way into AOSP / CM based roms. This is a way to achieve that on a stock rooted setup (Touchwiz) without high detail patching that the normal root user may not be in a position to do.
It assumes that for app data, you will have one named directory you bind everything to. For example, I have the default set as /extSdCard/bind. The script creates my new app directories within there, then binds the original over to it.
You have to set your defaults on first use before you can bind.
There is not yet a way of reversing a bind through the script. It can be done manually however. Scope for future.
The option to select defaults, in the terminal display is not a single column, which makes it tricky to see. You need to go to landscape mode for a better view.
Very few games have a hidden folder starting "." - These cannot be bound (copy issue)
How does it work?
We have in the attached zip, 2 scripts. 1 manages the set up of your defaults and mounts. The other does the daemon hijacking. The 1st calls the second script when a new mount is added (although I haven't confirmed this 100% working yet).
Script manager to be used to call the primary script but also it can be used to call the secondary too. The hijack needs to occur at every boot too.
I just wanted to say THANK YOU so much for this, I have been trying to solve the problem with little to no luck on 4.2.2. I even modded the extSD2InternalSD script which worked, but did not allow me to install applications to the extSD (now main SD).
I tried your scripts and it worked but none of the games I try to launch recognize it. File managers also see it as a different partition and the folders in the binded folder as blank files. I bound my Android folder (which contains my data and obb folder respectively). It shows as an alternately mounted device in file managers (FX Explorer, Total Commander) however upon adbing into the file system it shows that the bind did indeed work. (Root Explorer also shows the bind as working perfectly) These two sources show the bind as it was with DirectoryBind but the others do not and the games don't seem to see it either.
I have tried about 10 games and none of them read the data that is present in the bind, which makes me think there is something else small hindering this from going through. The games also state there is 'no space' left to download the game data when I am prompted to do so. I have successfully done this with DirectoryBind on 4.1 but your solution here is the closest I have come to it in 4.2.
Do you have any clues as to how to solve this or fix this? I have a lot of experience with symbolic links on various Linux distributions, but I am dumbfounded as to how to properly implement it within the Android framework. I really appreciate your hard work here, this is awesome and you should turn it into an app once it's in the state you want it to be in.
I will gladly offer any assistance I can to get this working right, a LOT of people need something like this especially gamers like me! Do you have a donation link? I will gladly send you a nice incentive to put some more time into this !(and to thank you for the work you have already done)
Device(s): International s3 with Neat Rom and Siyah kernel.
Carrier: 3 (three) UK £15 p/m unltd data/txt
Thanked 722 Times in 615 Posts
Re: [Script][4.2.x] Move /sdcard app data to /extSdCard (Wip) [updated 7th Mar]
What does depreciated mean in this context mate?
Think its a bit advanced for this forum? its had a good few views. Maybe people have just been rude and not thankd
EDIT "DEPRICATED" sorry, dislexya lol
GT-i9300 running Neat Rom with Siyah kernel.
A Scotsman. Be nice
Last edited by funkylogik; March 15th, 2013 at 09:57 AM.
Sorry, script doesn't work, I just not moved files to extSdCard (have Only created a folder) and I thought it works(((. I don't know what's wrong. I have CM 10.1,I did instruction completely, by option 3 I had chosen /extSdCard
Ps: Can I manually edit debuggerd.mnt to get android / obb/xx xx xx?
Sorry for my english)))
I will try to explain.
I have folder 123 with some txt file on my InternalSD and i have created 123 folder on extSdCard, but i have forgotten to move txt file to 123 folder and thought bind works. (I used option 5 in main menu to Bind my folders)
By default settings at option3 I choose /extSdCard, is it right?
Last edited by Chesterby; March 15th, 2013 at 10:16 PM.