HOW TO: Run games from USB drive

Search This thread
Oct 7, 2012
24
6
Yangon
A guide for original thread

Here is why it doesn't work in 4.2.1 and a possible fix that will have to be added to a custom ROM to make it work again:

http://xdaforums.com/showthread.php?p=36889027

Well maybe not... the fix should work for directory bind but only outside of /storage, /mnt/sdard, /sdcard.

This of course does us no good. Thanks brainbeatuk for the update.

Can you please post a working guide for 4.2.2? I read the original guide and watched YouTube video but I am on 4.2.2 and that methods and directory bind don't work. I am using Paranoid V3.15 and don't know if it is patched. Please update the guide for us. Thank you. :):):)
 

brainbeatuk

Senior Member
Oct 13, 2012
176
28
After trying for weeks to get working on 4.2.2 ran into compatibility problems. Your best bet is to install multirom. I have installed smoothrom4.1 to internal and also have installed a 4.2.2 rom . I then use the trick on first ROM and use other ROM when out n about

Sent from my Nexus 4 using XDA Premium HD app
 

VanillaG0rilla

Senior Member
Mar 15, 2012
534
117
Pittsburgh
Can you please post a working guide for 4.2.2? I read the original guide and watched YouTube video but I am on 4.2.2 and that methods and directory bind don't work. I am using Paranoid V3.15 and don't know if it is patched. Please update the guide for us. Thank you. :):):)

Both the rom and kernel need to have a fix implemented. PA is supposed to add the fix on the next build. Most custom kernels should have the fix. Once PA gets updated this should work again.

Sent from my SPH-D710 using xda app-developers app
 

lastot069

Senior Member
Feb 28, 2011
66
9
I have been thinking about making a little gaming cabenet out of an 8 gig with a broken screen, this helps a ton.
 

aish malik

New member
Apr 6, 2013
2
0
do not automount

Hey my nexus7 not auto mount USB drive
And when I try to mount with paragon NTFS then choose automaticly mount time then shows that Path
Storage/emulated/0/legacy/paragon NTFS + HFS
And when I go to paragon NTFS folder then the folder is empty
Please help
 
Oct 7, 2012
24
6
Yangon
After trying for weeks to get working on 4.2.2 ran into compatibility problems. Your best bet is to install multirom. I have installed smoothrom4.1 to internal and also have installed a 4.2.2 rom . I then use the trick on first ROM and use other ROM when out n about

Sent from my Nexus 4 using XDA Premium HD app

So I have to reboot the whole OS to play games or stuck in 4.1? PLEASE make this work my admired developers / hackers.
 

brainbeatuk

Senior Member
Oct 13, 2012
176
28
Well I have 4.1 smoothrom (last 4.1.2 smoothrom) on internal with a script to bindmount USB as sdcard. Using multirom and stock 4.1.2 kernel with multirom patch. See thread. I also have rasbeen 4.2.2 installed as other ROM through multiman and I fit Ubuntu also. I use rasbern when out n about and 4.1 smoothrom for games connected to a tb hardrive in storage says capacity 0.93 tb

Yes you have to reboot but you can be clever about installing games out n about casuals are small and usually install to secure internal which means still use your normal internal space. So if I install 30 gig of games internal will prob have used 3 gig in appdata and the rest is game data which is put in android/data android/obb on 4.1.2
Hope this helps prob doesn't I have dsypracxia apparently.
Sent from my Nexus 4 using XDA Premium HD app
 
Last edited:

adxgrave

Senior Member
Dec 24, 2011
262
52
So I have to reboot the whole OS to play games or stuck in 4.1? PLEASE make this work my admired developers / hackers.

Ok. I've use this script since a month ago and have use it to run nfs mount and directory binding successfully in 4.2.2 stock rom. I found it on the net and only remove a few line from it. All credit goes to the original author.

Requirement:
1. Root
2. Busybox install in /system/xbin
3. Stickmount
4. $cripter (search in Play Store) - this is use to run the script or you can run it manually in terminal without this app.

This is example script to bind FIFA12. All files needed for this game is in external sdcard under FIFA12 directory.

The one that did the job is the last line, so ONLY modify that line to suit your need (the one that start with "adb_send_cmd")

Step:
1. Mount your external media using stickmount
2. Copy all file from game folder to external media
3. Save the script somewhere in internal storage
4. Open $cripter and go to setting to set your script directory
5. After the script appears in $cripter, long press and select edit. Tick run as root and save.
6. Run the said script from $cripter.

Caveat:
If output from $cripter says something about device offline, just try again. That mean adb is not ready yet and nothing got mounted. Also just ignore the file not found line in the $cripter output. That got something to do with multiuser, the script did run. Sometimes stickmount mount the external media to somewhere different than sda1, so check that too.

Edit: if you get too many device offline error, try to set the sleep time longer in the script. Find the line start with sleep and change 2 to 5.

#!/system/bin/sh

adb_status=`getprop init.svc.adbd`
adb_port=`getprop service.adb.tcp.port`

if [ -z "$adb_port" ]; then
adb_port=-1
fi

adb_use_port=$adb_port
adb_connected=0
adb_sysroot=`getprop persist.sys.root_access`

if [ -z "$adb_sysroot" ]; then
$adb_sysroot=''
fi

adb_use_root=$adb_sysroot
adb_rsa_keyed=0
adb_key_at_connect=0

trap "adb_reset" EXIT

adb_send_cmd() {
adb_start_flex
adb -s localhost:"$adb_use_port" shell su -c "$*"
}

adb_start_flex() {
local adb_restart=0
if [ "$adb_use_root" != "3" ]; then
setprop persist.sys.root_access "3"
adb_use_root=3
fi

if ! [ "$adb_use_port" -gt 0 ]; then
adb_use_port=5556
setprop service.adb.tcp.port "$adb_use_port"
adb_restart=1
fi

if [ "$adb_connected" -eq 0 ]; then
if ! [ -f "$ANDROID_DATA/.android/adbkey.pub" ]; then
adb kill-server
HOME="$ANDROID_DATA" adb start-server
fi

grep -Fxq "$(cat $ANDROID_DATA/.android/adbkey.pub)" "$ANDROID_DATA/misc/adb/adb_keys"

if [ "$?" -ne 0 ]; then
cat $ANDROID_DATA/.android/adbkey.pub >> $ANDROID_DATA/misc/adb/adb_keys
adb_rsa_keyed=1
adb_restart=1
fi

if [ "$adb_restart" -eq 1 ]; then
adb kill-server
stop adbd
start adbd
sleep 2
fi

HOME="$ANDROID_DATA" adb connect localhost:$adb_use_port
adb_connected=1

fi
}

adb_reset() {
local adb_restart=0

if [ "$adb_connected" -ne 0 ]; then
adb disconnect localhost:$adb_use_port
adb_connected=0

if [ "$adb_rsa_keyed" -ne 0 ]; then
sed -i "\|$(cat $ANDROID_DATA/.android/adbkey.pub)|d" $ANDROID_DATA/misc/adb/adb_keys
adb_restart=1
fi

if [ "$adb_port" -le 0 ]; then
setprop service.adb.tcp.port "$adb_port"
adb_restart=1
fi

if [ "$adb_restart" -eq 1 ]; then
stop adbd
start adbd
fi
fi

if [ "$adb_use_root" -ne "$adb_sys_root" ]; then
setprop persist.sys.root_access "$adb_sys_root"
fi

if [ "$adb_status" == "stopped" ]; then
adb kill-server
stop adbd
fi
}

adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/FIFA12 /data/media/0/Android/data/com.ea.game.fifa12_row"

exit 0

Example mount:
1. NFS mount/umount
adb_send_cmd "/system/xbin/busybox mount -o nolock server_ipaddr:/path/to/server/nfsvolume /data/media/0/nfsmount
adb_send_cmd "/system/xbin/busybox umount /data/media/0/nfsmount"

2. Dungeon Hunter 4 mount/umount
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/DungeonHunter4 /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"
adb_send_cmd "/system/xbin/busybox umount /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"

3. Modern Combat: Zero Hour (2 mount point: data and obb in one script)
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/obb /data/media/obb/com.gameloft.android.ANMP.GloftM4HM"

adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/data /data/media/0/Android/data/com.gameloft.android.ANMP.GloftM4HM/files"


Sent from my Nexus 7 using Tapatalk 2
 
Last edited:
Oct 7, 2012
24
6
Yangon
Error running script

Ok. I've use this script since a month ago and have use it to run nfs mount and directory binding successfully in 4.2.2 stock rom. I found it on the net and only remove a few line from it. All credit goes to the original author.

Requirement:
1. Root
2. Busybox install in /system/xbin
3. Stickmount
4. $cripter (search in Play Store) - this is use to run the script or you can run it manually in terminal without this app.

This is example script to bind FIFA12. All files needed for this game is in external sdcard under FIFA12 directory.

The one that did the job is the last line, so ONLY modify that line to suit your need (the one that start with "adb_send_cmd")

Step:
1. Mount your external media using stickmount
2. Copy all file from game folder to external media
3. Save the script somewhere in internal storage
4. Open $cripter and go to setting to set your script directory
5. After the script appears in $cripter, long press and select edit. Tick run as root and save.
6. Run the said script from $cripter.

Caveat:
If output from $cripter says something about device offline, just try again. That mean adb is not ready yet and nothing got mounted. Also just ignore the file not found line in the $cripter output. That got something to do with multiuser, the script did run. Sometimes stickmount mount the external media to somewhere different than sda1, so check that too.



Example mount:
1. NFS mount/umount
adb_send_cmd "/system/xbin/busybox mount -o nolock server_ipaddr:/path/to/server/nfsvolume /data/media/0/nfsmount
adb_send_cmd "/system/xbin/busybox umount /data/media/0/nfsmount"

2. Dungeon Hunter 4 mount/umount
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/DungeonHunter4 /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"
adb_send_cmd "/system/xbin/busybox umount /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"

3. Modern Combat: Zero Hour (2 mount point: data and obb in one script)
adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/obb /data/media/obb/com.gameloft.android.ANMP.GloftM4HM"

adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/data /data/media/0/Android/data/com.gameloft.android.ANMP.GloftM4HM/files"


Sent from my Nexus 7 using Tapatalk 2

I don't know what's wrong. I copied and pasted your script and edit the last line.
I found your directories start with "/data/media/0/". I checked "/data" directory and found nothing in it. I think my directory is "/storage/emulated/0/" and "/storage/usbdisk/". Is this a problem? (I did not use stickmount because my rom auto-mount the usb)

$cripter output:

Error running script dataMount b/c:

Commands failed:
sh /storage/emulated/0/dataMount

/storage/emulated/0/dataMount[8] : :not found
/storage/emulated/0/dataMount[16] : :not found
/storage/emulated/0/dataMount[31] : syntax error:'then' unexpected

I am using ParanoidAndroid Version 3.15. (4.2.2). I will test with stock rom later. Please help me.
 

brainbeatuk

Senior Member
Oct 13, 2012
176
28
I've not tried script myself yet busy at work probably Monday I will. I'm gonna guess its the pa ROM I had issues earlier with pa.
Do you have busy box installed also?

Just read ya error. Yeah change line in script to usbstorage. See if works
Sent from my Nexus 4 using XDA Premium HD app
 

adxgrave

Senior Member
Dec 24, 2011
262
52
I don't know what's wrong. I copied and pasted your script and edit the last line.
I found your directories start with "/data/media/0/". I checked "/data" directory and found nothing in it. I think my directory is "/storage/emulated/0/" and "/storage/usbdisk/". Is this a problem? (I did not use stickmount because my rom auto-mount the usb)

$cripter output:

Error running script dataMount b/c:

Commands failed:
sh /storage/emulated/0/dataMount

/storage/emulated/0/dataMount[8] : :not found
/storage/emulated/0/dataMount[16] : :not found
/storage/emulated/0/dataMount[31] : syntax error:'then' unexpected

I am using ParanoidAndroid Version 3.15. (4.2.2). I will test with stock rom later. Please help me.

I don't have PA to figure it out but initially this is also my problem in stock rom. I've used /storage path before and it didn't work. I figured the correct path by looking at how stickmount mount my external drive. If I remember correctly I run mount command in terminal got it figured from there by looking at the "real" mount path used by Stickmount. Maybe you should do the same and look at PA auto-mount path.

Sent from my Nexus 7 using Tapatalk 2
 

pratmodi

Member
Aug 14, 2014
18
0
Games From USB Drive

Is this method risk free on my Moto G ? can my phone get bricked ? what if its phone's inbuilt sd card storage damages ?
 

psrkallez06

Senior Member
Dec 3, 2011
63
8
Using Galaxy S3 LTE with N4 Elite Rom, (Android 4.4.4.) is there any new solution to playing games from usb? I tried the script written earlier but i just end up with a bunch of errors and "folder not found" etc. Tips?
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 39
    NOTE: Currently only working on Android 4.1.2. I'll look for a workaround when my new OTG cables come in.

    So I purchased the 8 GB Nexus 7 and began to regret not getting the 16 GB version. These 1-3 GB games are killing me. I purchased The Bard's Tale (great game btw) and the TegraHD version requires 3.5 GB! I already had a USB OTG cable so I began looking for a way to store the game data on the USB drive and mount it to the data directory on the sdcard.

    You will need:
    • Compatible USB OTG Cable
    • Paragon NTFS&HFS+
    • GScript Lite
    • Compatible kernel (ntfs read/write support)

    I've tested this on ParanoidAndroid and SGT7 but it should work on any rom.

    Note: Each game requires a game data folder on the USB drive that matches my script (or you can create your own folder and edit the script). You will also need a blank folder on the sdcard (/sdcard/android/data/GAMEFOLDER_from_Script - You have to use this folder name). Once this folder from the USB drive has been mounted to the correct position on the SDCARD, the game data will download to the USB drive.

    Video: http://www.youtube.com/watch?v=4dWqLjnCSBg&feature=youtube_gdata

    NTFS USB Drive STEPS:
    1. Plug in USB drive to Nexus 7 and unmount if the system automounts the drive (Settings - Storage - Unmount shared storage)
    2. Open Paragon NTFS&HFS+ and mount the USB drive using the automatic mount point setting (/storage/usbdisk).
    3. Open GScript Lite and run a game script to bind mount the game data folder to the sdcard.
    4. Enjoy your game and extra space!
    5. When done, unmount with Paragon NTFS&HFS+.

    FAT32 USB Drive STEPS:
    1. Plug in USB drive to Nexus 7, it should be automounted by the system to the default location: /storage/usbdisk
    2. Open GScript Lite and run a game script to bind mount the game data folder to the sdcard.
    3. Enjoy your game and extra space!
    4. When done, unmount via the system: (Settings - Storage - Unmount shared storage)

    Assuming your USB drive is mounted on /storage/usbdisk/ and you have created the empty game data folder on the sdcard (/sdcard/android/data/GAMEFOLDER_from_Script), the following scripts should work:
    Code:
    Script for Horn:
    mount -o bind /storage/usbdisk/Horn /sdcard/Android/obb/com.Phosphor.Horn.Paid
    
    Script for Bard's Tale:
    mount -o bind /storage/usbdisk/BardsTale /sdcard/Android/data/com.inxile.BardTale
    
    Script for Max Payne:
    mount -o bind /storage/usbdisk/MaxPayne /sdcard/Android/data/com.rockstar.maxpayne
    
    Script for Dead Trigger (gave me an error the first time opened but worked fine afterwards):
    mount -o bind /storage/usbdisk/DeadTrigger /sdcard/Android/obb/com.madfingergames.deadtrigger
    
    Script for Shadow Gun THD:
    mount -o bind /storage/usbdisk/shadowgun /sdcard/Android/data/com.madfingergames.shadowgun_thd
    
    Script for Asphalt 7:
    mount -o bind /storage/usbdisk/Asphalt7 /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM
    
    Script for The Dark Knight Rises:
    mount -o bind /storage/usbdisk/TDKR /sdcard/Android/obb/com.gameloft.android.ANMP.GloftKRHM
    
    Script for Mass Effect Infiltrator:
    mount -o bind /storage/usbdisk/MassEffect /sdcard/Android/data/com.ea.games.meinfiltrator_na

    I'll add more scripts as time permits.

    Alternate Method (No scripts needed but you loose SDCard when USB drive is mounted):
    http://xdaforums.com/showthread.php?t=1865094
    4
    Directory Bind does not seem to be working with 4.2.1

    and does not look like the dev will ever update it as he has not been seen for almost a year on xda..

    a real shame as i use directory bind on my gnote

    Guys sorry I haven't been updating this guide since 4.2.1. Both my USB OTG cables have shorts in them so I haven't even attempted to find a workaround yet. I just ordered two more cables and will look into getting things working again on 4.2.1.
    2
    So I have to reboot the whole OS to play games or stuck in 4.1? PLEASE make this work my admired developers / hackers.

    Ok. I've use this script since a month ago and have use it to run nfs mount and directory binding successfully in 4.2.2 stock rom. I found it on the net and only remove a few line from it. All credit goes to the original author.

    Requirement:
    1. Root
    2. Busybox install in /system/xbin
    3. Stickmount
    4. $cripter (search in Play Store) - this is use to run the script or you can run it manually in terminal without this app.

    This is example script to bind FIFA12. All files needed for this game is in external sdcard under FIFA12 directory.

    The one that did the job is the last line, so ONLY modify that line to suit your need (the one that start with "adb_send_cmd")

    Step:
    1. Mount your external media using stickmount
    2. Copy all file from game folder to external media
    3. Save the script somewhere in internal storage
    4. Open $cripter and go to setting to set your script directory
    5. After the script appears in $cripter, long press and select edit. Tick run as root and save.
    6. Run the said script from $cripter.

    Caveat:
    If output from $cripter says something about device offline, just try again. That mean adb is not ready yet and nothing got mounted. Also just ignore the file not found line in the $cripter output. That got something to do with multiuser, the script did run. Sometimes stickmount mount the external media to somewhere different than sda1, so check that too.

    Edit: if you get too many device offline error, try to set the sleep time longer in the script. Find the line start with sleep and change 2 to 5.

    #!/system/bin/sh

    adb_status=`getprop init.svc.adbd`
    adb_port=`getprop service.adb.tcp.port`

    if [ -z "$adb_port" ]; then
    adb_port=-1
    fi

    adb_use_port=$adb_port
    adb_connected=0
    adb_sysroot=`getprop persist.sys.root_access`

    if [ -z "$adb_sysroot" ]; then
    $adb_sysroot=''
    fi

    adb_use_root=$adb_sysroot
    adb_rsa_keyed=0
    adb_key_at_connect=0

    trap "adb_reset" EXIT

    adb_send_cmd() {
    adb_start_flex
    adb -s localhost:"$adb_use_port" shell su -c "$*"
    }

    adb_start_flex() {
    local adb_restart=0
    if [ "$adb_use_root" != "3" ]; then
    setprop persist.sys.root_access "3"
    adb_use_root=3
    fi

    if ! [ "$adb_use_port" -gt 0 ]; then
    adb_use_port=5556
    setprop service.adb.tcp.port "$adb_use_port"
    adb_restart=1
    fi

    if [ "$adb_connected" -eq 0 ]; then
    if ! [ -f "$ANDROID_DATA/.android/adbkey.pub" ]; then
    adb kill-server
    HOME="$ANDROID_DATA" adb start-server
    fi

    grep -Fxq "$(cat $ANDROID_DATA/.android/adbkey.pub)" "$ANDROID_DATA/misc/adb/adb_keys"

    if [ "$?" -ne 0 ]; then
    cat $ANDROID_DATA/.android/adbkey.pub >> $ANDROID_DATA/misc/adb/adb_keys
    adb_rsa_keyed=1
    adb_restart=1
    fi

    if [ "$adb_restart" -eq 1 ]; then
    adb kill-server
    stop adbd
    start adbd
    sleep 2
    fi

    HOME="$ANDROID_DATA" adb connect localhost:$adb_use_port
    adb_connected=1

    fi
    }

    adb_reset() {
    local adb_restart=0

    if [ "$adb_connected" -ne 0 ]; then
    adb disconnect localhost:$adb_use_port
    adb_connected=0

    if [ "$adb_rsa_keyed" -ne 0 ]; then
    sed -i "\|$(cat $ANDROID_DATA/.android/adbkey.pub)|d" $ANDROID_DATA/misc/adb/adb_keys
    adb_restart=1
    fi

    if [ "$adb_port" -le 0 ]; then
    setprop service.adb.tcp.port "$adb_port"
    adb_restart=1
    fi

    if [ "$adb_restart" -eq 1 ]; then
    stop adbd
    start adbd
    fi
    fi

    if [ "$adb_use_root" -ne "$adb_sys_root" ]; then
    setprop persist.sys.root_access "$adb_sys_root"
    fi

    if [ "$adb_status" == "stopped" ]; then
    adb kill-server
    stop adbd
    fi
    }

    adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/FIFA12 /data/media/0/Android/data/com.ea.game.fifa12_row"

    exit 0

    Example mount:
    1. NFS mount/umount
    adb_send_cmd "/system/xbin/busybox mount -o nolock server_ipaddr:/path/to/server/nfsvolume /data/media/0/nfsmount
    adb_send_cmd "/system/xbin/busybox umount /data/media/0/nfsmount"

    2. Dungeon Hunter 4 mount/umount
    adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/DungeonHunter4 /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"
    adb_send_cmd "/system/xbin/busybox umount /data/media/obb/com.gameloft.android.ANMP.GloftD4HM"

    3. Modern Combat: Zero Hour (2 mount point: data and obb in one script)
    adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/obb /data/media/obb/com.gameloft.android.ANMP.GloftM4HM"

    adb_send_cmd "/system/xbin/busybox mount -o bind /data/media/0/usbStorage/sda1/MC4/data /data/media/0/Android/data/com.gameloft.android.ANMP.GloftM4HM/files"


    Sent from my Nexus 7 using Tapatalk 2
    2
    You can also use the app bind directory to mount and unmount works great even transfers files auto for you! I play all my games off a 32gb flash drive

    1. Basically install stickmount hook up your OTG Cable to your nexus 7 with your usb drive.

    2. Install bind directory.

    3. You have to know what folders have what in them so I use storage analyser to find what files are bigger.

    4. Create folders on your usb drive with names you can remember where you are mounting the games.

    5. Open bind directory and select the top part is where your data is going on the usb drive and bottom is where it is currently then check transfer data.

    6. Click the file to make it green and play!

    When unmounting hit the green file to make it grey and unmount from stickmount!

    Always back up your bind directory data base!

    Dead Trigger, O&C, GTA3 all work just fine.

    Sent from my Nexus 7 using xda app-developers app