Writing to File on External SDCard - Moto G 2015 Q&A, Help & Troubleshooting

I'm trying to write to a file on the external SDcard with an app, but it remains with permissions of 771. (execute only for Others) In Termianl I su and chmod 777 file, but it remains at 771.
This seems to mean the OS is preventing this file from being world writeable. Each app is run by a different user so I can't know which user will try to write at a given time. As root I can 'touch' new files all day, but I can't set them world-writeable.
What is preventing me from doing this?

Quantumstate said:
I'm trying to write to a file on the external SDcard with an app, but it remains with permissions of 771. (execute only for Others) In Termianl I su and chmod 777 file, but it remains at 771.
This seems to mean the OS is preventing this file from being world writeable. Each app is run by a different user so I can't know which user will try to write at a given time. As root I can 'touch' new files all day, but I can't set them world-writeable.
What is preventing me from doing this?
Click to expand...
Click to collapse
Umm... your external SD card is FAT32, it doesn't support Linux file attributes and permissions.

That's well and good, but look at it with the file manager.
And why can't I write into files on the external when I can on the internal?

Quantumstate said:
That's well and good, but look at it with the file manager.
And why can't I write into files on the external when I can on the internal?
Click to expand...
Click to collapse
Your app needs to have permission to use the ext storage... I have no problems with ES File Explorer, just has to select the SD card and the first time it prompts you to select the root and go. Then it's good, apps need to be built to be compatible with Marshmallow, how it addresses the SD card is different than previous Android versions.

Related

unable to write files to external sd card

I have owned a number of tablets but this is the first time I'm unable to write files to my ext. SD card. Anyone else have this issue?
Thanks
Mr Dasher said:
I have owned a number of tablets but this is the first time I'm unable to write files to my ext. SD card. Anyone else have this issue?
Thanks
Click to expand...
Click to collapse
I have the same issue when using any 3rd party file manager, but doing such through the built in one works. I suspect I just need to back up and format the card through the computer, try that and see how it works.
I ran into the same issue, but reformatting the external SD have no effect. Whether the system is grabbing hold of the extSD and locking out other apps is as yet unknown. Currently I am attempting to figure out how to root the unit so I can gain access with a better FileMngr than the stock one. Still waiting for the download during the reset to finish, so don't know if it will work.
FYI - My device is rooted and I am using ES File Manager and it still does not work.
Mr Dasher said:
FYI - My device is rooted and I am using ES File Manager and it still does not work.
Click to expand...
Click to collapse
Have you format your sd card? I've got same problem, but now it's ok with ES File manager
gacon1000 said:
Have you format your sd card? I've got same problem, but now it's ok with ES File manager
Click to expand...
Click to collapse
Are you sure? Try this:
Reboot the tablet.
Before you do anything else, start ES File manager, and immediately navigate to /mnt/sdcard/extStorages/SdCard.
Menu->New->Folder (leave the default and hit 'OK')
Did it create the folder or show an error message?
(This has become a puzzle for me. Sometimes I can read/write with ES, sometimes I can't. It's damn annoying...)
Mr Dasher said:
I have owned a number of tablets but this is the first time I'm unable to write files to my ext. SD card. Anyone else have this issue?
Thanks
Click to expand...
Click to collapse
I can't post a link to the original post on another forum that worked for me so I will quote it:
Simple solution for external sdcard write access on Android 3.2...if you're rooted
I've found a simple solution for gaining write access to the external sdcard (/mnt/sdcard2) on Android 3.2. The sdcard is mounted r/w, but the owning group is media_rw which is linked to the WRITE_MEDIA_STORAGE permission. Unfortunately, this permission was not required for access to the external sdcard prior to 3.2 so most file management utilities do not request it when they run...meaning they only have read access to the card.
The simple solution, if you're rooted, is as follows:
1. Using a root-enabled file manager, navigate to /system/etc/permissions and make sure you have mounted the file system r/w.
2. Edit platform.xml and find the WRITE_EXTERNAL_STORAGE permission.
3. Add an additional group definition for this permission...<group gid="media_rw" />
4. Save the changes to the file.
5. Restart your tablet.
After this change, any apps that request the WRITE_EXTERNAL_STORAGE permission (which includes almost anything that access either of the sdcards) will gain group membership in both sdcard_rw AND media_rw, giving them r/w access to both sdcard filesystems.
Interesting that it requires root to fix. You would think that even the Samsung file manager would be able to handle it, but it doesn't.
thaloneus said:
I can't post a link to the original post on another forum that worked for me so I will quote it:
Simple solution for external sdcard write access on Android 3.2...if you're rooted
I've found a simple solution for gaining write access to the external sdcard (/mnt/sdcard2) on Android 3.2. The sdcard is mounted r/w, but the owning group is media_rw which is linked to the WRITE_MEDIA_STORAGE permission. Unfortunately, this permission was not required for access to the external sdcard prior to 3.2 so most file management utilities do not request it when they run...meaning they only have read access to the card.
The simple solution, if you're rooted, is as follows:
1. Using a root-enabled file manager, navigate to /system/etc/permissions and make sure you have mounted the file system r/w.
2. Edit platform.xml and find the WRITE_EXTERNAL_STORAGE permission.
3. Add an additional group definition for this permission...<group gid="media_rw" />
4. Save the changes to the file.
5. Restart your tablet.
After this change, any apps that request the WRITE_EXTERNAL_STORAGE permission (which includes almost anything that access either of the sdcards) will gain group membership in both sdcard_rw AND media_rw, giving them r/w access to both sdcard filesystems.
Click to expand...
Click to collapse
@thaloneus:
Thanks for finding and posting that procedure. Was having that excact problem and after making the edit to permissions I am now able to write to the external sd card. ES file explorer now allows writing to the external sd as well as Titanium Backup.
Interesting note: Titanium was backing up to the internal sd. Once the external became available to write to I was able to create a backup folder there and ran another batch of backups.
thaloneus said:
I can't post a link to the original post on another forum that worked for me so I will quote it:
Simple solution for external sdcard write access on Android 3.2...if you're rooted
I've found a simple solution for gaining write access to the external sdcard (/mnt/sdcard2) on Android 3.2. The sdcard is mounted r/w, but the owning group is media_rw which is linked to the WRITE_MEDIA_STORAGE permission. Unfortunately, this permission was not required for access to the external sdcard prior to 3.2 so most file management utilities do not request it when they run...meaning they only have read access to the card.
The simple solution, if you're rooted, is as follows:
1. Using a root-enabled file manager, navigate to /system/etc/permissions and make sure you have mounted the file system r/w.
2. Edit platform.xml and find the WRITE_EXTERNAL_STORAGE permission.
3. Add an additional group definition for this permission...<group gid="media_rw" />
4. Save the changes to the file.
5. Restart your tablet.
After this change, any apps that request the WRITE_EXTERNAL_STORAGE permission (which includes almost anything that access either of the sdcards) will gain group membership in both sdcard_rw AND media_rw, giving them r/w access to both sdcard filesystems.
Click to expand...
Click to collapse
Thanks worked like a charm
Please someone provide me more details or give me the picture of the edited .xml thanks.
Sent from my GT-P6200L using Tapatalk
boonhim said:
Please someone provide me more details or give me the picture of the edited .xml thanks.
Sent from my GT-P6200L using Tapatalk
Click to expand...
Click to collapse
Here is a screenshot of the edited .xml
Sent from my GT-P6210
StingerDog said:
@thaloneus:
Thanks for finding and posting that procedure. Was having that excact problem and after making the edit to permissions I am now able to write to the external sd card. ES file explorer now allows writing to the external sd as well as Titanium Backup.
Interesting note: Titanium was backing up to the internal sd. Once the external became available to write to I was able to create a backup folder there and ran another batch of backups.
Click to expand...
Click to collapse
From what Ive found you need superuser access to the external sdcard to write to it. I've always been able to access the external sdcard with Titanium Backup as the location of the backup was the first thing I changed in its settings when I installed it. Root Explorer can write to it too. The only programs that can't are the ones without superuser access, ES File Explorer is one I have that I can't get its root explorer working, its not requesting superuser access, so it can't write to the sdcard.
Not sure if this has anything to do with the sdcard mounting to a pc as an MTP device instead of MSC or not but really irritated by that protocol. Not sure if this (MTP) is native to Honeycomb or if Samsung wanted the external storage accessed in this way.
Thank so much.
Sent from my GT-P6200L using Tapatalk
kzoodroid said:
From what Ive found you need superuser access to the external sdcard to write to it. I've always been able to access the external sdcard with Titanium Backup as the location of the backup was the first thing I changed in its settings when I installed it. Root Explorer can write to it too. The only programs that can't are the ones without superuser access, ES File Explorer is one I have that I can't get its root explorer working, its not requesting superuser access, so it can't write to the sdcard.
Not sure if this has anything to do with the sdcard mounting to a pc as an MTP device instead of MSC or not but really irritated by that protocol. Not sure if this (MTP) is native to Honeycomb or if Samsung wanted the external storage accessed in this way.
Click to expand...
Click to collapse
If you're still having trouble with apps not writing to the external sd, you might want to edit that .xml file thaloneus had mentioned.
Once I did that I had full access to write to that card from any app. Took me all of like five minutes to edit and test it out.
I'm having some trouble with this procedure. Like everyone else, I couldn't write to my external SD card using ES Explorer or what not, although the stock Samsung My Files explorer could (and strangely, if I use a Samba mount I could write to it from my Win7 PC).
Anyway I've rooted everything, and was about to edit platform.xml, but I can't save it. I don't have the ability to write to the system folder.
I think I've done the Mount rw thing, ES File Explorer's option to do it was disabled, but on File Expert it was available. For good measure, I also used the app "mount /system (rw /ro)" but even with all these tools, I still can't write to the system directory.
I'm at my wits end, any ideas?
Mochan said:
I'm having some trouble with this procedure. Like everyone else, I couldn't write to my external SD card using ES Explorer or what not, although the stock Samsung My Files explorer could (and strangely, if I use a Samba mount I could write to it from my Win7 PC).
Anyway I've rooted everything, and was about to edit platform.xml, but I can't save it. I don't have the ability to write to the system folder.
I think I've done the Mount rw thing, ES File Explorer's option to do it was disabled, but on File Expert it was available. For good measure, I also used the app "mount /system (rw /ro)" but even with all these tools, I still can't write to the system directory.
I'm at my wits end, any ideas?
Click to expand...
Click to collapse
What are you using to edit the .xml file? It may not have root explorer functions.
I used the Root Browser from ROM Toolbox to make and save the edit.
Worked for me with Root Explorer. I have tried most of the free file managers, and Root Explorer is worth every penny to me. It is the only app I have paid for.
StingerDog said:
What are you using to edit the .xml file? It may not have root explorer functions.
I used the Root Browser from ROM Toolbox to make and save the edit.
Click to expand...
Click to collapse
i used the free Astro File Manager to navigate to /system/etc/permissions/platform.xml. When I tapped on the platform.xml file I was given a choice of text editors to open it with. When I finished I was offered the option to save the file.
thaloneus said:
i used the free Astro File Manager to navigate to /system/etc/permissions/platform.xml. When I tapped on the platform.xml file I was given a choice of text editors to open it with. When I finished I was offered the option to save the file.
Click to expand...
Click to collapse
There you are thaloneus!
You made the one post that helped me fix that issue, then you disappeared. Glad to see you're back.
Thanks again!

[Resolved] Phone unable to use internal SD

I just has my USCC Galaxy S3 replaced under warranty. To save my internal SD files, I used an ADB pull /storage/sdcard0 in recovery. When I got the new phone rooted and CM10 installed, I booted to recovery and used an ADB push to restore the files. The files all ended back on the SD card, but now my apps cannot write to the folders on the SD card. The permissions are set to 644, and I cannot change them. I have tried with chmod and through file managers to change to 777, and although they claim success, the permissions stay 644. I'm unsure where to go from here, but I really would like to keep these files on my device. Any ideas on how to fix these permissions? Thanks!
Try copying/moving files around using the phone's file manager, & see if the changes stick. Also try "adb shell" -> "su", and change permissions that way, & see if it sticks.
Make sure you have an updated busybox.
Well, I tried moving them with file manager, su and updated busybox, changing permissions, and then I finally decided to go into recovery, pull, and format /sdcard. Once I did that, my apps were able to use the card again. I then was able to copy over the files via usb mount to windows. This seems to be working so far.
Thanks!

[Q] Es File Explorer storage RO/RW

Heya. Does someone knows why i can't change the sdcard storage to RW instead of RO, in Es File Explorer v3.0.3?
What i mean:
View attachment 2000780
andrei7radu said:
Heya. Does someone knows why i can't change the sdcard storage to RW instead of RO, in Es File Explorer v3.0.3?
What i mean:
View attachment 2000780
Click to expand...
Click to collapse
im guessing u granted it root permissions first in settings/root-settings?
andrei7radu said:
Heya. Does someone knows why i can't change the sdcard storage to RW instead of RO, in Es File Explorer v3.0.3?
What i mean:
View attachment 2000780
Click to expand...
Click to collapse
Storage is r/w by default-I think,
Are you expeariencing any troubles with writing to external storage?
Edit: on the app level:
An app asks permission to write to external, on instalation
You- as a user are always allowed to write to...
This in app option is perhaps needed when a part of internal memory,
Is used as sd card- as it is in tablets or htc one x...
or it is an ext (system ) partition, that option is concerned about...
anyway, I'm using es... for ages now, and never have had any troubles with
mounting sd card as r/w
jmcclue said:
im guessing u granted it root permissions first in settings/root-settings?
Click to expand...
Click to collapse
Yeap. Otherwise i wouldn't be able to change and save the others 2 (main root and /system), which i can.
asgardr said:
Storage is r/w by default-I think,
Are you expeariencing any troubles with writing to external storage?
Click to expand...
Click to collapse
That's right ... the in initial state should be RW. I can manipulate the files from Es FE (cut/copy/paste and delete), but i can't change any file's properties or permissions. Strangely, the only ways i can see the storage via usb connection are MTP and PTP (and same behaviour - cut/copy/paste and delete - but no properties changes available - greyed out). If i switch to Media Storage, the PC only displays Removable Storage and prompts me to insert it. Huh?
andrei7radu said:
Yeap. Otherwise i wouldn't be able to change and save the others 2 (main root and /system), which i can.
That's right ... the in initial state should be RW. I can manipulate the files from Es FE (cut/copy/paste and delete), but i can't change any file's properties or permissions. Strangely, the only ways i can see the storage via usb connection are MTP and PTP (and same behaviour - cut/copy/paste and delete - but no properties changes available - greyed out). If i switch to Media Storage, the PC only displays Removable Storage and prompts me to insert it. Huh?
Click to expand...
Click to collapse
Are you running- by any chance- any aosp 4.2.2/4.1.2 rom?
I have the same symptoms on them,
just installed third party app from the market,
and my problem is gone (pc)
as for es.. I've never had any troubles with changing atributes
or permissions
Edit: it is this brand new shiny inrerface of es file explorer,
that makes many- including me- to get confused and sometimes lost- at first
asgardr said:
Are you running- by any chance- any aosp 4.2.2/4.1.2 rom?
I have the same symptoms on them,
just installed third party app from the market,
and my problem is gone (pc)
as for es.. I've never had any troubles with changing atributes
or permissions
Edit: it is this brand new shiny inrerface of es file explorer,
that makes many- including me- to get confused and sometimes lost- at first
Click to expand...
Click to collapse
Using a CM10.1 (see my signature). I'm starting to think that the problem isn't ES's. When i connect the device as a Media Storage i get the following feedback from the status bar: "Connected as an Installer" ... never seen this before.
Will try to restore an earlier backup to check if lest an app is conflicting ... dunno ... I'll return the result.
P.S.
You're right about ES's fresh interface ... a little confusing after using the ancient one for a l.l.long time. Missing the pop-up on long press, instead of (the new) select feature. Eh ...
As for atributes of the files on sd card- I think it does not matter what they are,
because an external storage is a slave disc for the system..
which uses it only as storage...
different story would be if a part of such a slave drive is partitioned to be used as an extention
of an internal memory (ext partition )
but then it is not been seen from the level of a file manager...
Edit: I belive, the trouble with mounting usb disk drive,
is (or at least I think) purely on the system's side..
Would not be bad, if somebody else could comment,
or clarify the matter further though
strange that it dont work coz i just tried it and no problems
menu/root explorer (grant permissions) /mount r/w and i can delete, copy/paste, everything really.
Have u tried uninstalling es file explorer then installing it again?
jmcclue said:
strange that it dont work coz i just tried it and no problems
menu/root explorer (grant permissions) /mount r/w and i can delete, copy/paste, everything really.
Have u tried uninstalling es file explorer then installing it again?
Click to expand...
Click to collapse
Yes, uninstalled it and reverse, but no change. I restored an earlier backup with only a few (necessary) third-party apps, but the problem is still there. Also, if anyone can answer, what the heck is "Connected as an installer" status when selecting Media Storage? Thanks.

[ROOT] Move obb folder to external SD (mount -o bind folder)

Using on CM11, should work for any android build above 4.#.#
If you are having trouble mounting folders like I did like SuperMount, FolderMount didn't work for me
Even if they work, they require payment for most important features
Get BusyBox (Most custom ROMs already have it, like CM)
I used busybox mount because regular mount didn't work
Get the SManager app
Move the contents of obb folder to somewhere in external SD, (Or you can move the entire obb folder and create an empty obb folder in sdcard/Android)
Create new script from SManager (or any other text editor and save it with .sh extension) and type the mount command in it
Lets say I moved the folders inside obb to storage/sdcard1/obbfolders, then command is:
busybox mount -o bind /storage/sdcard1/obbfolders/ storage/sdcard0/Android/obb
Save the file (in SManager you press back after typing and it asks if you want to save)
Click on the file you created and check the Su and Boot boxes and Save
Script should be good to go, click Run
I use FX File Explorer to verify it (obbfolders should be shown on the main page)
Reason I created this thread, I searched this for a quite good amount of time and couldn't find anything
All "mount folder android", "mount bind android" searches either come up dead or show me an app that doesn't work for me
needo2 said:
Using on CM11, should work for any android build above 4.#.#
If you are having trouble mounting folders like I did like SuperMount, FolderMount didn't work for me
Even if they work, they require payment for most important features
Get BusyBox (Most custom ROMs already have it, like CM)
I used busybox mount because regular mount didn't work
Get the SManager app
Move the contents of obb folder to somewhere in external SD, (Or you can move the entire obb folder and create an empty obb folder in sdcard/Android)
Create new script from SManager (or any other text editor and save it with .sh extension) and type the mount command in it
Lets say I moved the folders inside obb to storage/sdcard1/obbfolders, then command is:
busybox mount -o bind /storage/sdcard1/obbfolders/ storage/sdcard0/Android/obb
Save the file (in SManager you press back after typing and it asks if you want to save)
Click on the file you created and check the Su and Boot boxes and Save
Script should be good to go, click Run
I use FX File Explorer to verify it (obbfolders should be shown on the main page)
Reason I created this thread, I searched this for a quite good amount of time and couldn't find anything
All "mount folder android", "mount bind android" searches either come up dead or show me an app that doesn't work for me
Click to expand...
Click to collapse
Trying to follow your guide....can't get it to work ?
1: Moved the entire OBB folder to my SD
2: Installed busybox, started it, software says it is installed, there's a button to install again....don't know what else it does ? If I click install, well, it installs again
3: Created the new script, saved it, ran it. It seems OK
4: When I open FX File explorer, I don't know what I'm looking for, I don't see anything going on, no operations running ?
...I didn't want to delete the original OBB directory since I don't have confirmation of this working ?
Thanks for your help
almost there...
Hi there
Had the same problem and found your thread after quite some surfing. Following your instructions, all seemed to work fine, just had to inject an "su" before the busybox mount command, then the whole external_sd (/storage/sdcard1/) was mounted to an existing (empty) folder on the internal sd (/storage/emulated/legacy/External_SD)... at least that's how it looks in SManager. When checking the target folder via file explorer, it still looks empty.
My setup:
- Samsung S4 mini on Cyanogenmod 10.2
- phone is not fully rooted, but root is granted to SManager and Busybox
- external sd card has permissions "d---rwxr-x" and is owned by "system" whereas the internal storage has permissions "drwxrwxr-x" and is owned by "root"
do I face a permission issue?
If yes, how to solve that (tried to change permissions of the External_SD folder recursively using chmod -R under root... but didn't suceed)
If not, any ideas...???
Thanks for any hint!
cheers
I'm using Lucky Patcher to bind oob folder, you should try.
@needo2: Is it required to mount the folder? This could cause problems on rejecting sd card. Maybe it does work replaceing the source directory with a simple link ("ln -s") to sd?

Path to Mounted EncFs

Forgive me if this is in the wrong place.
I'm using EDS Lite to mount an EncFs directory. That works fine. I can access the directory from file managers when it's mounted. That's fine. I don't have any trouble accessing the encrypted files when I want them.
BUT:
Suppose I'm using a program that doesn't have one of those simple sidebars that lets you access different things. A program like App2SD. Suppose I can access any directory from the Root, but I don't have a nice shortcut that takes me directly to a mounted file system. So the important question is:
What is the path to the mounted EncFs system?
With other mounted file systems, I know a couple ways to get there. For example, I can get to the SD card from Root/storage/###-####, or from Root/mnt/media_rw/####-####. With the second partition on my SD card, I can get there using Root/data/sdext2. But now, what about the mounted EncFs file system I have? How could I reach that from the root directory? How could I get there?

Categories

Resources