[TOOL] DirectoryBind - move data to external_sd (GameLoft, Shadowgun etc.) ROOT req.

Search This thread

slig

Senior Member
Sep 14, 2008
131
762
After reboot device, your app asks two times for SU permission.

Application starts, checks what is mounted and what should me mounted. Next the thread is started that waits until media are available and then mounts entries. It is possible that su permissions will be requires several times. In fact application requires permissions multiple times during start but if that requests are delayed in time several monits may appear. If You do not want to remember application for permanent access You could change "access time" in superuser settings to, for example 60 seconds.
 

Luftwaffe

Member
Oct 17, 2007
27
1
Houston
good day! I find the app very useful (store Google music data on external sd of my Samsung Galaxy Plus) but keeps on crushing, would be very grateful if you could help fixing it, the log file below

--------- beginning of /dev/log/system
E/AndroidRuntime( 7096): FATAL EXCEPTION: main
E/AndroidRuntime( 7096): java.lang.RuntimeException: Unable to pause activity {com.quoord.tapatalkxda.activity/com.quoord.tapatalkxda.activity.ForumNavigationActivity}: java.lang.NullPointerException
E/AndroidRuntime( 7096): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2548)
E/AndroidRuntime( 7096): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2505)
E/AndroidRuntime( 7096): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2483)
E/AndroidRuntime( 7096): at android.app.ActivityThread.access$700(ActivityThread.java:122)
E/AndroidRuntime( 7096): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1031)
E/AndroidRuntime( 7096): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7096): at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime( 7096): at android.app.ActivityThread.main(ActivityThread.java:4123)
E/AndroidRuntime( 7096): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7096): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime( 7096): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime( 7096): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime( 7096): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7096): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 7096): at com.quoord.tapatalkxda.activity.PasswordCrypt.encrypt(PasswordCrypt.java:260)
E/AndroidRuntime( 7096): at com.quoord.tapatalkxda.activity.ForumNavigationActivity.onPause(ForumNavigationActivity.java:946)
E/AndroidRuntime( 7096): at android.app.Activity.performPause(Activity.java:4492)
E/AndroidRuntime( 7096): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1196)
E/AndroidRuntime( 7096): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2535)
E/AndroidRuntime( 7096): ... 12 more
E/AndroidRuntime( 7548): FATAL EXCEPTION: main
E/AndroidRuntime( 7548): java.lang.RuntimeException: Unable to start service com.vanpit.android.directorybind.DirectoryBindService@40882790 with null: java.lang.NullPointerException
E/AndroidRuntime( 7548): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2220)
E/AndroidRuntime( 7548): at android.app.ActivityThread.access$1800(ActivityThread.java:122)
E/AndroidRuntime( 7548): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1087)
E/AndroidRuntime( 7548): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7548): at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime( 7548): at android.app.ActivityThread.main(ActivityThread.java:4123)
E/AndroidRuntime( 7548): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7548): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime( 7548): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime( 7548): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime( 7548): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7548): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 7548): at com.vanpit.android.directorybind.DirectoryBindService.onStartCommand(DirectoryBindService.java:53)
E/AndroidRuntime( 7548): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2207)
E/AndroidRuntime( 7548): ... 10 more
E/AndroidRuntime( 7604): FATAL EXCEPTION: main
E/AndroidRuntime( 7604): java.lang.RuntimeException: Unable to start service com.vanpit.android.directorybind.DirectoryBindService@4096d300 with null: java.lang.NullPointerException
E/AndroidRuntime( 7604): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2220)
E/AndroidRuntime( 7604): at android.app.ActivityThread.access$1800(ActivityThread.java:122)
E/AndroidRuntime( 7604): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1087)
E/AndroidRuntime( 7604): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7604): at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime( 7604): at android.app.ActivityThread.main(ActivityThread.java:4123)
E/AndroidRuntime( 7604): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7604): at java.lang.reflect.Method.invoke(Method.java:491)
E/AndroidRuntime( 7604): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
E/AndroidRuntime( 7604): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime( 7604): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7604): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 7604): at com.vanpit.android.directorybind.DirectoryBindService.onStartCommand(DirectoryBindService.java:53)
E/AndroidRuntime( 7604): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2207)
E/AndroidRuntime( 7604): ... 10 more
--------- beginning of /dev/log/main
I/DirectoryBind( 9862): Main activity started.
I/DirectoryBind( 9862): Checking root privileges.
I/DirectoryBind( 9862): Root privileges available.
I/DirectoryBind( 9862): Checking entry usage - /sdcard/extStorages/SdCard/Music/artwork/
I/DirectoryBind( 9862): Checking entry usage - /sdcard/extStorages/SdCard/Music/music/
 

blueeagle69

Senior Member
Jan 28, 2012
316
59
Entry name

Hi.

I just switched to your DirectoryBind from GL to SD.
Would it be possible to add an option to give each entry a name?

Thanks for your time.
 

slig

Senior Member
Sep 14, 2008
131
762
@Luftwaffe: Look like the bug that was reported and corrected earlier. Are You using newest version "0.2.0o" ??

@blueeagle69: It's possible. I'll look into that.
 
  • Like
Reactions: blueeagle69

blueeagle69

Senior Member
Jan 28, 2012
316
59
@Luftwaffe: Look like the bug that was reported and corrected earlier. Are You using newest version "0.2.0o" ??

@blueeagle69: It's possible. I'll look into that.
Thank you.

Apologies, one more idea popped into my head,

When selecting where the source data should be on the extern_sd, would it be possible for the app to automatically create the correct named folder?
For instance, Blood & Glory's data files live in the following directory path.
/sdcard/android/data/com.glu.gladiator_nr/
So, what I mean is, the user selects "sdcard/android/data/" and the app automatically creates the games root folder "com.glu.gladiator_nr". Information it gets from selecting the Target path. It easier than having to remember exactly what the game's data folder was labelled.
I hope I have made sense :)
Brilliant app. Even though you have a little more to do than GltoSD, your app tends to work first time everytime. And you don't have to rememeber to mount & unmount all the time.
 

blueeagle69

Senior Member
Jan 28, 2012
316
59
The only thing I can recommend, because I'm new to it myself is to go
into preferences and make sure Alternate dbase management is ticked.


Sent from my Nexus S using Tapatalk
 
Last edited:
  • Like
Reactions: confusedmuse

davelinders

Senior Member
Jan 27, 2011
622
83
Hey slig thnx for this beautifull program.
With the "o" version I don't have any problems
so every binding that I make works.
 

fipsib

Senior Member
Jan 16, 2011
589
785
Munich
Would be great if you could point out in the OP, that on Cyanogenmod the external SD isn't /mnt/sdcard/external_sd but /mnt/emmc/!

[didn't knew that & therefor wasn't able to use DirectoryBind until I found out that it is mounted differently ;)]
 

donat3llo

New member
Nov 28, 2010
2
0
Works great, thank you! I'm on CM7 and using it to bind /emmc to /sdcard/external_sd.

I think it would be a little bit more user friendly if there was a directory chooser in addition to the text field.
 

Laci4

New member
Feb 11, 2011
3
0
46
Budapest
Thank you!
Unfortunately, I do not know English, but google translation helps.
Galaxy W works perfectly!
 
Last edited:

Garyth

Senior Member
Jan 4, 2011
52
17
@Slig
Thanks for the app, makes testing variations of cyanogen, miui, etc much easier.

Currently using app on Captivate running:
[ROM][ICS4.0.3] WeUI v0.6.5 (MIUI4 Unofficial Port)


the only (small) issueI found is:
With auto mount on boot enabled: if you reboot with usb wall charger plugged in the mount will fail and show red icon. It works fine on reboot if the charger is unplugged during reboot. You can manually bind by Unbind (even though it's not bound) and then Bind it. I get same issue if plugging into computer, it unmounts fine but fails on remount after usb disconnect.

I tried variations of delayed bind, no change. I would surmise that it is a quirk in the auto unmount on usb; however unplugging after the fact does not cause it to mount.

log shows on reboot with usb charger:
I/DirectoryBind( 1017): Service operation: ONBOOT.
I/DirectoryBind( 1017): Performing bind-on-boot.
I/DirectoryBind( 1017): Checking root privileges.
I/DirectoryBind( 1017): Root privileges available.
I/DirectoryBind( 1017): Trying to bind all checked.
I/DirectoryBind( 1017): Delayed mount TASK CREATE /emmc/;/mnt/sdcard/external_sd/.
E/DirectoryBind( 1017): Target or data is not a directory!
E/DirectoryBind( 1017): Delayed mount FAIL /emmc/;/mnt/sdcard/external_sd/.


log shows on unplugging from computer:
I/DirectoryBind( 1017): Service called (onStartCommand).
I/DirectoryBind( 1017): Service operation: ONUSBDISCON.
I/DirectoryBind( 1017): Performing bind-on-usb-discon.
I/DirectoryBind( 1017): Checking root privileges.
I/DirectoryBind( 1017): Root privileges available.
I/DirectoryBind( 1017): Trying to bind all checked.
I/DirectoryBind( 1017): Delayed mount TASK CREATE /emmc/;/mnt/sdcard/external_sd/.
E/DirectoryBind( 1017): Target or data is not a directory!
E/DirectoryBind( 1017): Delayed mount FAIL /emmc/;/mnt/sdcard/external_sd/.

To be clear:
The mount works manually
The mount on boot works on reboot with no usb plugged in.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 694
    Hi all !

    This is my application to bind directories located on external_sd to directories on internal memory (/sdcard/). This way You can transfer large application data directories to external_sd. Could be usefull with ex.: games from Gameloft, other like Shadowgun, applications like CamScanner.

    screenshot:
    SC20111225-111214.png
    SC20120105-183116.png


    SC20120105-183406.png
    SC20120105-183427.png


    Features:
    * Requires ROOT !
    * Aimed at specific functionality and features (not idiot-proof)
    * You can create any number of Data -> Target directory pairs, mount them manually or choose to mount them on system boot (checkbox does that).
    * On/Off switch controls whole mount-on-boot function.
    * Diskette icon indicates if mount operation was successful, by taping it You can mount/umount entry.
    * Icon changes if application is using mounted entry
    * DirectoryBind can tell what application is using this entry (tap at entry in use)
    * Long tap on entry (disabled) brings edit/delete window
    * App auto umount all entries on USB connected and remount after USB disconnected (for now via BroadcardReceiver UMS_CONNECTED / UMS_DISCONNECTED)
    * App shows notification and vibrates if auto umount on USB fails
    * If mounting all checked entries (ex. on boot) app is waiting specified time (def. 60 sec) if data directory is not available (happens sometimes at boot)
    * Tested sucessfully with Asphalt 6, Shadowgun, DeadSpace, CamScanner

    Color statuses:
    * GRAY - entry disabled
    * RED - mount failed
    * BLUE - waiting for data availability
    * GREEN - mounted OK

    version 0.2.0k
    * fixed FC if screen orientation changes during copy/delete
    * more extensive logging

    version 0.2.0m
    * ?? fixed problem with entries marked green on boot, but not mounted (repotred by stone_ship)
    * ?? fixed problem with random FC on ICS (reported by Thomas)

    version 0.2.0n
    * auto create target directory action moved from "bind" action to "add/edit entry" action due to possible problems when data outside "/sdcard"

    version 0.2.0o
    * added option to control if mount service is run as sticky

    *** for now older version kept in case I broke something ***

    please do not test data transfer files features on sensitive data they seem to work OK but are not throughly tested

    Compiled using API android 2.3.3. Attached as self-signed development apk package. No market link for now.

    important info
    * Remember ! All entries must be umounted before attempting to use MASS STORAGE MODE. Application will try to do it automatically on USB CONNECT. If it fails and You'll use MASS STORAGE MODE sdcard partition WILL CRASH and reboot will be required to restore normal operations ! Main cause of that is appplication using mounted folder. You have to close that application and retry to umount entry.

    * This application requires *root privileges* so it has full control over entire system! Uses root privileges to invoke "mount", "umount", "lsof" and "grep" shell commands via su and it DOES NOT write anything on system partitions.
    It DOES NOT apply any permanent changes to the OS, however I cannot guarantee it does not contain BUGS and security issues. I'm not responsible to any damage it can cause. Use it AT YOUT OWN RISK !

    application permissions explained
    WRITE_EXTERNAL_STORAGE - application automatically creates target path, copy existing files from target to data
    RECEIVE_BOOT_COMPLETED - application can perform automatic bind on boot
    VIBRATE - application creates notification alert with vibrations when cannot umount all locations on USB connect
    READ_LOGS - dump own logcat to file
    *ROOT* - invoking "mount", "umount", "lsof" and "grep" commands via su

    BUGS REPORTING
    As every program can contain bugs so this one too. I'm very grateful if someone find and report a bug. No report will go unattended and I'll look into each case. There is just one thing, often report even very detailed is not enough so application has built in logging (logcat) capability - it can be enabled in Preferences.

    Logcat can be dumped to file from main app window: menu -> dump logcat to file
    So when reporting bug please attach that file to Your post :)

    Regards !
    Slig

    !!! IF YOU HAVE ISSUE WITH ENTRIES DISAPPEARING AFTER REBOOT !!!
    1. In preferences check "alternate dbase mgmt" and try again
    2. Report in this thread with informations
    - does "alternate dbase mgmt" help ?
    - are you using any taskkiller
    - what ROM are you using

    I need to know how many people have this issue, maybe it would be good to make "alternate dbase mgmt" default mechanism.
    Sorry for that but I'm still learning and doing by best to make this app as much compatible and usable as possible. This is my first public app for android ;)
    29
    Moved to "Themes and Apps" section.
    15
    How do we get this to work? I've moved my game files to my sd card on my otg cable for my nexus 7 and I've tried to mount the obb folder using this http://xdaforums.com/showthread.php?t=2155363 but my games such as Asphalt still tell me to download data :/

    I haven't tested it with obb folders tbh. I just added my bind commands to the debugger.mnt file then executed remount.sh.

    (I think I'm going to release an app to make everyone's life easier. It'll have a modern GUI, intuitive layout, and compatible with 4.2.2). I'll post a link to it here once it's all finished. :good:
    7
    Later posts seems to sound like the posters are blaming or are angry with the author of the app. This is really sad.

    Anyway, I would like to answer some questions and hope that people would be more polite in the future as the author wrote the app for free and saved a lot of people time and effort. Without the app, people like me usually wrote script to mount the links and now we have nice GUI to do that. I am most thankful for the auto unmount feature. Previously when using script, I must make sure that I unmount the link before unmounting the external card (to mount to pc). If I forgot that, then the external card would later fail to bind anymore until I restart my device.

    On the version, the higher the number, the newer it is. If the number is the same, then the later alphabet is newer, meaning "b" is newer than "a".

    On the app itself, it is a frontend to perform mount/unmount, while allowing moving files automatically. So, whatever limitation you are facing is on the OS, not the app. The app helps you to move files (when creating the link), helps you mount the link (on every reboot), helps you unmount the link when your external card is unmounted (and remount it), and helps you move back the files when you delete the link. It uses mount and umount to perform the linking/unlinking process. They are commands that come with the busybox.

    On why source is the external card and the target is the original path, the author uses the parameter naming used by mount and umount. When mounting, the source is where the data is, while the target is where you want it to appear. Mount also requires that the target directory must exists and empty. If it does not exists, the mounting process would fail.

    For installing app, as long as there are sufficient space to where the OS is installing it to, it will install successfully. If it complains that there are insufficient space while there is plenty, then it has something to do with what you have done, such as rogue odex file (normally caused by cracking apps with Lucky Patcher). There are also cases where the app to be installed is at fault. This would normally be solved when the app is updated.

    So, I hope I clear up some confusion with this post and please, if you can't get any apps developed freely by generous developers to work while others have no problem, try to understand how they work and do some research before bashing the authors.

    Thanks.

    Sent from my GT-N7100 using Tapatalk 2
    6
    ...I've been living the dream ever since a ... scripter produced a solution to the FAT32 limitation on AOSP.
    I doubt that. :) Tech should be working for you, you shouldn't be working for the tech. If you ever are, you should ditch it and use something else.
    Directory Bind no longer works on 4.2 though. There are some workarounds I've been made aware of but they're very technical and I haven't tried them yet​
    BTW, there are fixes, technical is a relative term. I created a workaround to the 4.2 issue and it is what I use. I even attached my proxy wrapper at the bottom of the project so people could play with it.

    ...

    Ok, I'm going to threadjack a bit here. I'm the person who wrote that script. However, I have been informed that there would be more demand for an app like this one -- and slig has been MIA for a little over a year. When I check out Google, I see a bunch of bad instructions on blogs, and people making a bunch of incorrect statements. (Particularly regarding 4.2)

    As an example, I rebound inside data/data manually -- worked fine. It's just that this tool is broken because of the zygote-restricted-slave-mountspace bug/feature. Most of the problems seem to come from the lack of a GUI, not the lack of it being possible.

    I see a need for a New Unified Volume Daemon (NuVold). Something that is (1) GUI/Play Store based (2) portable across devices + integrates in Android Storage Manager for SD (3) mounts + repairs wacky filesystems (4) on partitioned devices (5) can rebind directories (6) softlink/install apps to SD card. [Swapping internal/external storage is not needed (and pointless) if something can do (5) and (6) in a user-friendly way.]

    Currently, multiple utilities do each in a semi-broken and nonconsistent way. (Paragon broken on 4.2, my script can sorta do 2-5 but via command line, Directory Rebind broken, ExtSd2InternalSd hijacks mount at boot...)

    Essentially, I am proposing a merger of my "fuse-mountsd", "Super APP2SD", "Directory Rebind", "Paragon's FS App" (the execution, not the proprietary stuff), "StickMount", "ntfs-3g", and "exfat-fuse". This is possible, but would require a lot of work. Plus there's no way you could charge for it, given all the chefs.