Hi,
i'm trying to move the data folder of google photos to my external sd card.
i entered in ssh and created a symlink (with ln -s) of the folder /data/data/com.google.android.apps.photos --> my sdcard.
i updated the authorization of the symlink and of the files on the sdcard, i changed the group/owner also.
from a 'ls -l' the link looks like the original directory.
it's not working, it looks like google photo can't write/update its "database" file
I thought maybe google photo doesn't have the right WRITE_EXTERNAL_STORAGE but it has.
I have two partitions on my sdcard, vfat and ext4, do i need to link to a specific one maybe ?
What i'm doing wrong ?
thanks
Related
Hi !
I have an application (CamScanner) with large amount of data (~8Gb). This app doesn't support transfering data do external SD card, so I checked mount -o bind command to bind directory with data stored on external SD to directory in /sdcard and it's working correctly. Question is where I can put this command so that system will run it at boot time after external sd card is ready. There is no /etc/init.d directory on my SGS2 (stock XXKI4). I prefer not to install any applications to perform such a simple task...
Thanks for help, regards !
slig said:
I prefer not to install any applications to perform such a simple task...
Click to expand...
Click to collapse
I think you have no choice, as stock kernels do not have init.d support. You'd need to go down the route of either using an app to run a script on boot, install a kernel with init.d support, or stick with your current method of manually running a script when you need to use the app.
Also, you could try asking the developers kindly to allow saving to external_sd. There's an Email Developer link on the Android market, and a Contact Us link on their website
Thanks for response. I found script named init.rc located in "/", it has several mount commands inside, wonder if it can be used...
Also discovered that app Tasked has ability to run shell scripts with root privileges (at boot or at application start). I suppose I have to put this shell script in /system because in /sdcard owner permissions cannot be set so that file cannot be modified (vfat does not support that) and a security hole would be created...
I think that I'll also ask developer for this feature as You suggest.
slig said:
Thanks for response. I found script named init.rc located in "/", it has several mount commands inside, wonder if it can be used...
Click to expand...
Click to collapse
Everything in "/" is initramfs, a volatile ramdisk changes to which would be lost
on reboot. Only exception are directories in which actual partitions are mounted,
like /system and /data (you can check which directories with "mount" command).
Have you tried just using symbolic link?
INFO
This may be the best solution, try something like:
Code:
mkdir /sdcard/AppFolder
ln -s /sdcard/AppFolder /data/data/com.your.application.data.folder
Just in case you don't know, you can execute those command using
Terminal Emulator. You were considering modifications to /, so I guess you already have root.
Yes, I have rooted my SGS2 via ZergRush.
I didn't know that / is volatile initramfs, thanks for that information.
As for symbolic link - unfortunately on my stock ROM both /sdcard and /sdcard/external_sd filesystems are vfat and don't support symbolic linking. Only working way I discovered is bind mount.
In my case, I have the following:
mount -o bind /sdcard/external_sd/CamScanner /sdcard/CamScanner
And application runs OK, all data is accessible and doesn't consume internal flash memory.
I'll take a look how hard would be to write some small application to do just this task - define some pairs of source and target directories and mount - bind them at start.
I've somehow missed the fact that you're need redirection from /sdcard
to /sdcard/external_sd, I was thinking about symlink on /data...
Anyways, there another nice trick you can do - if you can devote your SD card
to this one application, then just edit /system/etc/vold.fstab to make SD card
mount in /sdcard/CamScanner instead of /sdcard/external_sd.
Is it possible for a DEV to could come up with a way to mount the ext SD card as the primary and the internal as secondary. Then you could insert a SanDisk 64GB class 10 and resolve the running out of primary memory problem.
Thanks
Bill
Found This from another DEV
I found this from another DEV. Anyone tried it? Can a DEV insert this in a ROM for an easy update? Does this work?
READ ENTIRELY BEFORE TRYING
First off I did a lot of research and found how to mount the ext-sdcard inside the int-sdcard automatically with a lot of trial and error. This only needs to be done if you are planning on porting a rom that does not have an ext-sdcard mount built into vold.fstab file like our Thrive does. This is a quick mod tutorial. If you do not know what you are doing than please do not attempt. I am not responsible for your device(s). Try at your own risk. This mod worked on my Shazaam rom. Here we go....
All these step are as if you are working from your computer on a rom.zip. No adb guidence given.
Unpack the rom.zip....
1. Mod The Build.Prop inside /system/ folder. Open the file with Notepad++ to edit. Copy and paste the code below at the bottom of your build.prop file and save
Code:
# Mount the externel SD card, too
ro.additionalmounts=/mnt/sdcard/sdcard2
2. Mod The Vold.Fstab file inside /system/etc/ folder. Open the file with Notepad++ to edit. Locate the line containing sdcard2 line and delete that entire line. Replace with code below, then save and close.
Code:
dev_mount sdcard /mnt/sdcard/sdcard2 auto /devices/platform/sdhci-tegra.2/mmc_host/mmc1
3. You must copy over the vold file from the /system/bin folder from the stock Thrive rom inorder for this to work.
4. Final and hardest mod, Modding the boot.img ramdisk files. Mod the init.antares (If you do not know how to unpack and pack the boot.img then stop here, and forget about this mod until you do know how):
First locat the line:
mkdir /mnt/sdcard 0000 system system
Replace with:
mkdir /mnt/sdcard 0666 system system
Insert the code below right above # create directory for mounting usb drives:
exp ort EXTERNAL_STORAGE2 /mnt/sdcard/sdcard2
mkdir /mnt/sdcard/sdcard2 0666 system system
symlink /mnt/sdcard/sdcard2 /sdcard2
Repack the boot.img. Build your rom with these mods in place and the ext-sdcard will automatically mount inside the int-sdcard. Enjoy......
vold.fstab
Here is a copy of my vold.fstab file. Does anyone know how to rewrite it to flip flop memory in phone and make the SD Card the primary memory?
Hello everyone.
Yesterday I received my Huawei Honor 3C and I've installed MIUI ASAP instead of Emotion UI.
Everything's great but I have a problem with double SD Card, I mean: I have my own external card and the phone got his own by emulating it's internal storage as SD Card (it's a symlink to /storage/emulated/0 and it's the same as /storage/emulated/legacy, so this fake sd is eating up my storage, there are also other symlinks in /storage/, /mnt/ and even in root folder there is a symlink sdcard->/storage/emulated/legacy). Phone and apps are correctly seeing external card as SD Card but in reality the internal storage is being used for everything.
Because of this I have only about 5GB available instead of 64GB
Is there any way to terminate the emulation or changing it's target to sdcard2 so that I could use my card correctly? I've tried few things but nothing works. Symlinks are being recreated during boot so editing or deleting them does not work. Editing vold.fstab does nothing because ext is being mounted after boot while the emulation stars while in it - I guess that a proped ini script could do the work.
huaweiproblem said:
Hello everyone.
Yesterday I received my Huawei Honor 3C and I've installed MIUI ASAP instead of Emotion UI.
Everything's great but I have a problem with double SD Card, I mean: I have my own external card and the phone got his own by emulating it's internal storage as SD Card (it's a symlink to /storage/emulated/0 and it's the same as /storage/emulated/legacy, so this fake sd is eating up my storage, there are also other symlinks in /storage/, /mnt/ and even in root folder there is a symlink sdcard->/storage/emulated/legacy). Phone and apps are correctly seeing external card as SD Card but in reality the internal storage is being used for everything.
Because of this I have only about 5GB available instead of 64GB
Is there any way to terminate the emulation or changing it's target to sdcard2 so that I could use my card correctly? I've tried few things but nothing works. Symlinks are being recreated during boot so editing or deleting them does not work. Editing vold.fstab does nothing because ext is being mounted after boot while the emulation stars while in it - I guess that a proped ini script could do the work.
Click to expand...
Click to collapse
First thing I do to troubleshoot that stuff is to copy everything off the internal storage, then format it in recovery, then copy everything back when booted up.
Why do you think that wiping and installing the exact same stuff could help? If you're copying back the same files that were there before - then you're back at starting point.
I've tried also a few different things, mostly trying to modify inid.rc scripts.
I found an interesting script in init.ssd.rc, that is:
Code:
on init
# See storage config details at source.android.com/tech/storage/
# fix non-shell uid process can not access shared-sd
mkdir /mnt/shell 0700 shell shell
chmod 0750 /mnt/shell
chown shell sdcard_rw /mnt/shell
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /mnt/shell/emulated/0 0700 shell shell
mkdir /storage/emulated 0555 root root
mkdir /storage/sdcard1 0000 system system
export EXTERNAL_STORAGE /storage/emulated/legacy
export SECONDARY_STORAGE /storage/sdcard1
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
mount tmpfs tmpfs /storage/emulated mode=0705,uid=1023,gid=1023
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
symlink /mnt/shell/emulated/0 /storage/emulated/0
symlink /storage/sdcard1 /mnt/sdcard2
and so I deleted those symlinks, packed up the ramdisk and flashed boot.img with those changes... still nothing, the symlinks are still being recreated every boot.
Damn, what a stupid thing. I've found a solution on 4pda forums. I was trying to do it the complicated way while I had everything in the system settings, in a hidden MIUI menu with some untranslated chinese marks.
Under battery settings there are options in chinese, I just had to choose the fifth chinese one and change the storage options :victory:
huaweiproblem said:
Damn, what a stupid thing. I've found a solution on 4pda forums. I was trying to do it the complicated way while I had everything in the system settings, in a hidden MIUI menu with some untranslated chinese marks.
Under battery settings there are options in chinese, I just had to choose the fifth chinese one and change the storage options :victory:
Click to expand...
Click to collapse
Glad you solved it. The reason I mentioned the wipe and all because it's not an uncommon issue when switching from some stock system to custom ones (like CM, etc) where they change the mount point of external from /sdcard to /sdcard0 and it will just copy everything from /sdcard/ to /sdcard0 and you'll have copies of everything which cuts the storage in half. Case in point: http://forum.xda-developers.com/showthread.php?p=51709918#post51709918
Hi I am a newbie here and I hope I posted on the correct forum.
I am having a problem with my Spreadtrum SC7731 phone. It's internal storage symlink which is /sdcard /storage/sdcard0 is being broken at boot(I think). This started when I flashed supersu through twrp to root the phone. This happens after booting and then a notification will pop up and say "SD card removed, please insert a new one". After that prompt, Apps will then lose access to the Internal Storage and when you check the /storage directory, there is a sdcard0 folder inside it but it is not linked to /storage/emulated/0 which makes this directory virtually useless. I have figured out a work around myself by deleting the directories created at boot and recreating the symlinks with a small script I created:
Code:
su
rm -R /sdcard
rm -R /storage/sdcard0
ln -s /storage/emulated/0 /sdcard
ln -s /storage/emulated/0 /storage/sdcard0
after running this script, apps will have access to the internal storage and the /sdcard in the root directory is again accessible. But sometimes, it will lose its symlinks again so I have to run the script if it happens.
Again this happens after booting, then a notification will appear that the sdcard has been removed. after that happens, I checked the symlinks and its broken.
I don't really know what is the root cause but the work around is quite a hassle for me. I am looking for like a permanent solution to fix this. I don't have an External SD Card and I am not planning on buying one since the Internal Storage is Enough for me as I do not game on this phone.
bump
Bump
help pls
Hi, I recently compiled a TWRP for E506 plus, the problem is that the internal memory of the device is /data/media but the TWRP continues reading /data/media/0 also creating a new folder inside the internal memory called 0. In this way it is not possible to install zip from the internal memory if not manually browsing to /data/media, how can I solve?
I also tried to modify the fstab like this:
Code:
/sdcard auto /data/media
But it didn't work and I also tried to create a symlink but nothing.
Device Tree: https://github.com/XRedCubeX/twrp_device_E506plus
Thread closed per OP request.