[Q] Symbolic Linking - General Questions and Answers

Hello,
I am trying to find a way to free space on my Samsung Galaxy Centura (SCH-S738C) without rooting. I thought symlinks would be the answer to all my problems, because the phone stock comes with the ln command.
However, this is what I have done and the outcome:
/mnt/sdcard is the emulated SD-card that is really internal storage.
/mnt/extSdCard is the true removable SD-card.
I can create a text file on the external SD-card, for example /mnt/extSdCard/test.txt
ln -s /mnt/extSdCard/test.txt /mnt/sdcard/text.txt
Link is created sucessfully.
cat /mnt/sdcard/test.txt will display the contents of test.txt located on external SD.
However, if I try to link for example Minecraft PE worlds from the external SD to internal storage, the link is created successfully, however the game does not see the files.
I am not sure why this is, the links work properly, I can see the linked files if I 'ls /mnt/sdcard/games/MinecraftWorlds/' but the game wont see them.
Is there a reason for this? Obviously the links are successful since I can 'cat' a text file link and see its contents?
Thanks.

I think I ran into this problem trying to run games on linux from installs on my windows partition. But I think that may have been because of the different filesystems or some other problem.
Maybe the game can't see through symlinks. :0

Related

[Q] Moving and linking Folders to external SDCard (eg Google Music cache)

Hello folks,
I am trying to move my google music cache to the external 32GB SD card so that it won't fill up my internal storage but somehow I fail.
Here is what I did so far:
format sdcard as ext2
manually mount sdcard since it won't automatically when ext:
Code:
mkdir /Removable/MicroSD
mount -r -w -t ext2 /dev/block/vold/179\:9 /Removable/MicroSD
mkdir /Removable/MicroSD/GoogleMusicData
Then move all data from /sdcard/Android/data/com.google.android.music/cache to /Removable/MicroSD/GoogleMusicData/cache
I did this with root explorer since I'm not too much of a terminal h4xx0r.
Delete the folder /sdcard/Android/data/com.google.android.music/
Link the new Folder on external MicroSD Card to the original location via this terminal command:
Code:
ln -s /Removable/MicroSD/GoogleMusicData /data/media/Android/data/com.google.android.music
Since /sdcard is already a link like the one I am setting up here, it is not possible to link to this linked location (/sdcard/Android/data/com.google.android.music).
Instead I had to link to the origninal destination of /sdcard which is /data/media.
Now the microSD card is accessible for root explorer. It shows read and write access.
But google music won't find it. It says that it doesn't have enough space to stream music so I figure that it somehow doesn't have access to the sd card.
What could be the issue here?
Also instead of 28GB free memory root explorer shows me only 364,44MB free memory. the command "df" in terminal however confirms 28GB of free memory.
I thought that a reboot might do it. But it doesn't. Instead it gets rid of all the hacking I've done in terminal. So I guess I would have to place a script in /etc/init.d for the link to be set everytime I reboot, right?
Help please?
We don't know how gmusic checks that, but I would suggest checking the perms on the mount, perhaps even mounting somewhere else.
Never done it and don't have the resources but I'm sure with root, making /mnt/sdcard a real microsd is possible.
Sent from my Transformer Prime TF201 using Tapatalk
Maybe this thread will help ?
Thanks for your response!
What do you mean by "checking the perms on the mount"?
I don't want to mount my microsd to /sdcard since then I would have 16 gigs of unused space on my internal memory.
I would rather just link this music folder to my external card and maybe some others later (e.g. DCIM and so on).
I have also tried the mount -o bind command instead of ln but that didn't do the job either. the folder com.google.android.music then only appeared under /data/media/Android/data/ but not under /sdcard/Android/data/ which I totally don't understand how that can happen.
I have root of course.
Does anybody maybe have a script by hand of a similar undertaking so that I can look into that and try to understand how this whole mounting and binding thing works?

[HACK] How to move games' SD card data to internal memory

I recently bought ShadowGun and N.O.V.A 2 from Google Play and discovered that my SD card didn't have enough room with all of my music (10+ GB) and misc. other stuff, and I had around 6 GB of extra space on my internal memory, so I figured this out.\
Pre-requisites:
Plenty of space on your internal memory
Root access
Note: This has only been tested with SD card data that was already downloaded, but you should be able to download directly to internal memory. Also, this has only been tested on my Droid X running MIUI.
Step 1.
First, find your game's data location. ShadowGun's is at
Code:
/sdcard/Android/data/com.madfingergames.shadowgun
and N.O.V.A 2's is at
Code:
/sdcard/gameloft/games/GloftN2HM
Step 2.
Next, create the new folders in /data/data and /data/local for the Market cache. (Without this, the Market gives a "insufficient storage" error.)
Code:
adb shell
su
mkdir /data/data/ShadowGun
mkdir /data/data/GloftN2HM
mkdir /data/local/cache
Step 3.
If you haven't downloaded the game's data yet, skip this step.
If it's already on your SD card, then move the data from the folders we found before to the folders you just created.
Code:
mv /sdcard/Android/data/com.madfingergames.shadowgun/* /data/data/ShadowGun/
mv /sdcard/gameloft/games/GloftN2HM/* /data/data/GloftN2HM/
Step 4.
Finally, copy the following commands into a shell script:
Code:
mount -o bind /data/data/ShadowGun /sdcard/Android/data/com.madfingergames.shadowgun
mount -o bind /data/data/GloftN2HM /sdcard/gameloft/games/GloftN2HM
mount -o bind /data/local/cache /data/data/com.android.vending/cache
If other apps are crashing with insufficient storage errors, just link them all to /data/local/cache.
You can find whatever way you want to run this script every time you boot, but the easiest way is to download Script Manager from Google Play and set it to use su and to run at boot.
Step 5.
For those who haven't downloaded the SD data yet, download it and see if it takes up any more space on your SD card. I haven't tried it before, so no guarantees.
Uninstalling:
To uninstall, just move files back to SD card, disable script running at boot, and reboot.
I AM NOT RESPONSIBLE IF YOUR PHONE BLOWS UP, YOUR DOG GETS WORMS, OR WW3 STARTS. Thank you.
Can I do this with GPS iGO data (about 400 MB)?
worked on my xperia U! tried dead trigger game
The files will be at internal memory but also show at sd like they are there.. for exemple if we delete it on sd it will delet the file in internal memory!
Going to try with more games
Why is good do this?
i did the factory reset and i have all games on my SD like FIFA 12 etc.
is it possible to do it that way?
+ i am little mixed up with the code, where should i do it?
i can create folders and move data through file managers but not sure about the mount and bind action.
i downloaded scrip manager and console was showing Shell...is it the one i should write the commands as mentioned?

Solved! How to swap the internal and external SD cards so apps install externally

If you are like me and bought the 16GB version of our beloved SG3, thinking you could always move apps to the external sd card, then this mod is for you. It swaps the internal and external sd cards so apps install on your external card, because your phone is fooled into thinking the external card is the internal card.
I suggest that if you are going to do this, you should probably do it right after installing a new ROM, and before you install any apps. That way everything will get installed onto the external SD card.
I didn't invent this, Zedomax adapted in from mattiadj. But most people haven't been able to get it fully working, probably due to variations in the init.d function of various ROMS. They'd be able to see the External SD card as the internal SD, but the internal SD would disappear. This method avoids using init.d, and instead uses the app Script Manager to load the script on boot.
After much fooling around, I figured out how to do it so the External SD card and the internal cards are swapped, but you can see both with any file Explorer. I got it working on CleanROM 2.0, but it should work on Beans 10 as well.
Here's how to do it: Warning, if you do not understand the following instructions, or don’t have experience doing these things, you probably don’t want to do this hack. I am not responsible if you a) brick your phone, b) delete your data, or c) get very frustrated. That being said, the most likely failure will be that you only see the one card (the External card).
Back everything up that you care about first!!!!
1. First, I'd recommend making a Nandroid backup of your phone.
2. Next, just to be extra safe, I would backup your internal SD card to your PC. While you are doing that, if you have data on the external SD card, back that up too.
3. Next, I would format your external SD card to fat 32. (You could probably use Ext format too, but I didn’t test that.)If you already have it in that format, and have content on it, this won't affect the content, but back it up just to be safe. It’s probably better to have the Ext SD blank to begin with, you can always copy back its content from your pc.
4. Next copy the contents of the internal SD to the External SD card. This is to avoid confusion about apps and such.
5. Next install script manager free from the play store:
https://play.google.com/store/apps/...anager&feature=nav_result#?t=W251bGwsMSwyLDNd
It will show up on your phone as S manager ads.
6. Download the mod from here: http://downloadandroidrom.com/file/...ternalsd_gs3_fat32orextfat_US_ZEDOMAXv0.2.zip
7. You’ll see a folder called: 11extsd2internalsd_gs3_fat32orextfat_US_ZEDOMAXv0.2.zip
You need to unzip the folder, then go to System/etc/init.d and copy the 11extsd2internalsd file from there to your phone. Put it into the /data directory. Use Root Explorer, and your phone will need to be rooted.
(https://dl.dropbox.com/u/6305/SD Card Hack SG3/11ext file in data directory.png)
Or you can get just the 11extsd2internalsd file here: https://dl.dropbox.com/u/6305/SD Card Hack SG3/11extsd2internalsd
8. Using Root Explorer, navigate to that file in the /data directory. Press and hold the file name until the menu pops up, and click on permissions.
https://dl.dropbox.com/u/6305/SD Card Hack SG3/Permissions.png
(Unix geeks set them to 777, and everyone else copy the picture below. Click OK.
https://dl.dropbox.com/u/6305/SD Card Hack SG3/Permission settings 777.png
9. Open the script manager app, and select Browse as Root in the config screen. Tell it to remember this setting.
https://dl.dropbox.com/u/6305/SD Card Hack SG3/Script manager browse as root and save.png
10. Navigate to the /data directory and choose the 11extsd2internalsd file that is located in /data and click on it. Click on the “Is script” button.
11. Now tap on the buttons that say Su, Boot, and Save. The file name will come up in yellow after the save.
https://dl.dropbox.com/u/6305/SD Card Hack SG3/Script manager setting after save.png
12. Reboot your phone and you should see the swap working and be able to access both internal and external SD cards. The external card will show up as sdcard, and the internal card will show up as extSDCard. Your apps should now install to the external card, since your phone will think it's the internal card. Is that confusing? It was to me too!
Good luck and please share your experiences specifying which ROM you used, so that others can avoid frustration.
Thank you’s always appreciated.
Wonder if this works on asop roms as well.
Please excuse my Galaxy S III, it's a bit Paranoid.
On my X2, this same mod was done via a flashable zip...not sure how it worked, but it was worked perfectly. At some point the roms incorporated the flip flop as part of the Rom. I like the feature because I wouldnt need to move certain app data to my external sd card. Also, I wouldn't have to show tibu where to look for my backups.
Sent from my SCH-I535 using Tapatalk
Clienterror said:
Wonder if this works on asop roms as well.
Please excuse my Galaxy S III, it's a bit Paranoid.
Click to expand...
Click to collapse
What's the consensus on this? Can this mod as posted above be applied to AOSP/CM9/CM10?
Just flashed this on aokp and both sdcard and external_sd are my physical sd card. The internal card is not showing.
Op, can we get an cm10 ver?
Did a little playing around. Below seems to work on cm10 aokp. Can op confirm this is good?
mount -t vfat -o umask=0000 /dev/block/vold/179:97 /storage/sdcard0
mount -o bind /data/media /storage/sdcard1
maniac2k said:
Just flashed this on aokp and both sdcard and external_sd are my physical sd card. The internal card is not showing.
Op, can we get an cm10 ver?
Click to expand...
Click to collapse
Are you actually flashing it, or using the Script Manager? As far as I know, only the Script Manager approach works.
maniac2k said:
Did a little playing around. Below seems to work on cm10 aokp. Can op confirm this is good?
mount -t vfat -o umask=0000 /dev/block/vold/179:97 /storage/sdcard0
mount -o bind /data/media /storage/sdcard1
Click to expand...
Click to collapse
Not sure, but take a look at the code from 11ext2internalsd file. If it works, and you can see both sd cards, then you've nailed it.
Yeah sorry, im running the script apk. It seems to work. I just dont understand the exacts of the vold/179:97 or if it should be vold/197:96?
When i go into settings/storage, should my physical sdcard stats be showing under internal memory?
Thanks I got mines to work now. Thanks to your suggestions.
Sent from my SCH-R530U using Xparent SkyBlue Tapatalk 2
Update: ive been using the script below for a littlw while and it is working great on cm10. It is best to enable it after a fresh rom install.
mount -t vfat -o umask=0000 /dev/block/vold/179:97 /storage/sdcard0
mount -o bind /data/media /storage/sdcard1
I need to do this.
MODERATOR.
This is not a Q&A Thread. Needs to be moved to appropriate location.
Apps Did Not Move After Internal / External SD Swap for GS3
Well I thought everything went perfectly because as mentioned, when I go to storage my internal shows my 64g card and internal of 12g now shows as external. However the apps are still on my internal which is now called my external and when I go to app manager it shows remaining space 5.9g. So I am not sure what I did wrong because I have reviewed this several times and started right after I installed a fresh rom . I am hoping someone can help me correct this because basically all it did was change the name of the two drives but apps are still getting installed to original location. Thanks in advance for any help you can give me
Swapping internal>external did not work
i followed all steps as stated above but when I go to File Manager (default), long pressing Internal SD>Details show 1.2 MB and External SD shows 1.8 GB which is not true. I have external SD of 8 GB and internal is 2 GB in my micromax a110 phone.
The steps above did not work to swap the memory but it now shows even incorrect size. I installed Root Browser lite but got no way to chck the size of the SD cards.. Please help
Does this work with the new Verizon Jelly Bean which they are now sending out via OTA? Are there other Verizon S3 Jelly Bean Roms that are known to work with this method? Thanks
Its works on the leak so i dont see why it wouldnt work on the actual vz rom
not working
This is not working with my samsung s duos please help
Any cm 10.1 updates for this?
I am unable to change the file permissions to -rwx-rwx-rwx- whenever I try to change it I get an error that the phone is unable to change permissions.
EDIT:
Successfully changed permissions and followed the instructions as given. Still not working on the international S3, my internal memory is still 16 GB and external 32GB

Swap sdcard with external_sd under CM 11

Hi there,
I got a little problem swapping the "internal" sdcard with the external_sd card (64gb micro SD). I tried some ways already:
- App "external 2 internal"
- Add this line "persist.sys.vold.switchexternal=1" to /System/build.prop
- Try to modify the vold.fstab in etc folder, but there is no file with that name. Only a file called vold, but it contains only bytecode
All of them fails =(
I'm running CM 11 (cm-11-20140104-SNAPSHOT-M2-xt897).
I would say it's an easy task, done with 1 or 2 simple commands in a shell, isn't it? Please help me.
Thanks a lot.
Greetings Meik
No idea, someone?
There were some options for this added to customized builds of CM10.2...
But this has not persisted for CM11. Emulated storage makes this quite a bit more difficult than it used to be.
I guess most of us just "deal" with the small 8gb internal SD.
Since yesterday I go rid of the emulated sdcard mount.
It involved hacking boot.img and framework-res.apk to be inline with the legacy devices like the nexus one.
Now I just have the external sd mounted as /sdcard and all the internal memory on /data is available for apps.
The storage overview also correctly displays the configuration. And it should now be possible to move apps to sd, at least the menu entries are shown.
I will try to put together a flashable zip and start a new thread so everybody can easily achieve this.
Stay tuned!
It's done!
You will find the thread here:
http://forum.xda-developers.com/photon-q-4g-lte/development/mod-classic-sdcard-mount-t2804085/post53883989

how to make a autorun script on android 6,and mount tf card,360 qiku n5 cellphone

i want my 360 qiku n5 cellphone to use the tf card as an internalSD card, and also link to the /data/data diretory,so that I can make the storage more sufficient.
i have so many app to install, and the app use much space consuming up the internal space,leaving the tf card empty.
i'd tried making tf card ext4 and mounted to /mnt/sdcard-ext,and maked a link "ln -s /mnt/sdcard-ext/data /data/data",but the apps just crashed as soon as they started.then i deleted the link and cellphone return normal.
after try i found using the "su, mount" script to mount tf card on any directory,the nornal apps which do not use "su" can't read the mount point,I think that's why i link the tf card to /data/data but apps could not start. So how can i solve this problem?I use the supersu as the root and have allready turn off the "Mount namespace separation" option.
And how can i make a startup autorun script on the android6 phone?
Anybody help me please?
This will not work how you want. Apps on SD cards only work with Googles new feature to make the sdcard as internal storage. But even that is buggy due to the sdcard code that has never been made to work for apps on sdcard.

Categories

Resources