1

I want to move a game's obb (1GB) to an SD card. Copied the obb file to SD card, and symbolic link by:

su
ln -sf /storage/sdcard1/Android/obb/com.game /sdcard/Android/obb/com.game

but failed with "function not implemented".

I googled it, and got "some filesystem doesn't support symbolic link".

So I tried to use mount by command:

su
mount -o bind /storage/sdcard1/Android/obb/com.game /sdcard/Android/obb/com.game

but I found only root can see the files in the folder. Then I do:

cd /system/bin/
chmod 4777 ./toolbox #make anyone can use mount(in toolbox)
su u0_aXXX #the game's uid
mount -o bind /storage/sdcard1/Android/obb/com.game /sdcard/Android/obb/com.game
ls -l /sdcard/Android/obb/com.game
$ -rwxrwx--- u0_aXXX sdcard_r com.game.obb

But when I

cat /sdcard/Android/obb/com.game/com.game.obb
$ cat: /sdcard/…ame.obb permission denied

I'm using Android 5, any solution?


(I posted this question on Stack Overflow before, then I found here may be a better place to post this question.)

1 Answer 1

0

Finally, I found the solution to this question by myself! The app can't access the obb by itself, it requires media_rw to access it. Found by lsof:

sdcard 340 media_rw 15 ??? ??? ??? ???
/data/media/obb/com.game/com.game.obb
sdcard 340 media_rw 17 ??? ??? ??? ???
/data/media/obb/com.game/com.game.obb
com.game 26335 u0_a266 36 ??? ??? ??? ???
/storage/emulated/0/Android/obb/com.game/com.game.obb
com.game 26335 u0_a266 37 ??? ??? ??? ???
/storage/emulated/0/Android/obb/com.game/com.game.obb 

So I have to mount the external sdcard folder to two places and each has to have its right owner:

owner    folder
u0_a266  /storage/emulated/legacy/Android/obb/com.game
media_rw /data/media/obb/com.game

But if I mount /storage/sdcard1/Android/obb/com.game to those two places, it will become:

owner    folder
u0_a266  /storage/emulated/legacy/Android/obb/com.game
u0_a266  /data/media/obb/com.game

Then I found if I do:

mount -o bind /storage/sdcard1/Android/obb/com.game /storage/emulated/legacy/Android/obb/com.game
mount -o bind /mnt/media_rw/sdcard1/Android/obb/com.game /data/media/obb/com.game

I found this works fine, because the mount command's source and destination is their original owner. The app can run very well!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .