HOW TO: Run games from USB drive

Oct 7, 2012
24
6
0
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://forum.xda-developers.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
0
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
73
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
 

aish malik

New member
Apr 6, 2013
2
0
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
0
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
0
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
0
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
0
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
0
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
0
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
 

psrkallez06

Member
Dec 3, 2011
35
5
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: