[Q] KitKat Cyanogenmod Still Trouble Using External SDCard - General Questions and Answers

I am a programmer with experience working on Linux, brand new to Android. Recently I got my first Android phone, a Moto G 4G (XT1045) and installed CM11-20141009-NIGHTLY-peregrine on it. Today I bought a 32GB SDCard and formatted it to ext4 filesystem with AParted.
So it seems like cyanogenmod kernel should have SDCard fix for kitkat built in. Now I have a specific problem. I am trying to switch Titanium Backup to use sdcard1 as backup the location. So I have to browse to that folder.
My sdcard seems to be mounted in two places:
/mnt/media_rw/sdcard1
/storage/sdcard1
but both of them have problems. /storage/sdcard1 is a fuse mount and is read-only, even to root. I can browse there with TitaniumBackup, but then TitaniumBackup can't write any backups. /mnt/media_rw/sdcard1 is writable, and I can make directories on it from adb. But TitaniumBackup cannot browse inside of it, because media_rw is only accessible to user 1023(AID_MEDIA_RW). So I can't point TitaniumBackup to my sdcard!
How to fix this?

colinw1 said:
I am a programmer with experience working on Linux, brand new to Android. Recently I got my first Android phone, a Moto G 4G (XT1045) and installed CM11-20141009-NIGHTLY-peregrine on it. Today I bought a 32GB SDCard and formatted it to ext4 filesystem with AParted.
So it seems like cyanogenmod kernel should have SDCard fix for kitkat built in. Now I have a specific problem. I am trying to switch Titanium Backup to use sdcard1 as backup the location. So I have to browse to that folder.
My sdcard seems to be mounted in two places:
/mnt/media_rw/sdcard1
/storage/sdcard1
but both of them have problems. /storage/sdcard1 is a fuse mount and is read-only, even to root. I can browse there with TitaniumBackup, but then TitaniumBackup can't write any backups. /mnt/media_rw/sdcard1 is writable, and I can make directories on it from adb. But TitaniumBackup cannot browse inside of it, because media_rw is only accessible to user 1023(AID_MEDIA_RW). So I can't point TitaniumBackup to my sdcard!
How to fix this?
Click to expand...
Click to collapse
Hmmm. There have been problems with ext sd cards in cyanogenmod nightlies in the past and it is bound to happen. Not sure.
But try a CM11 snapshot instead of the nightlies as it is more stable with fewer bugs or wait for nightly updates which are very frequent.
Oh and make sure you do a nandroid backup before trying the CM11 Snapshot just in case.
https://download.cyanogenmod.org/?device=falcon&type=snapshot
Cheers!

CuckinFunt said:
Hmmm. There have been problems with ext sd cards in cyanogenmod nightlies in the past and it is bound to happen. Not sure.
But try a CM11 snapshot instead of the nightlies as it is more stable with fewer bugs or wait for nightly updates which are very frequent.
Oh and make sure you do a nandroid backup before trying the CM11 Snapshot just in case.
Cheers!
Click to expand...
Click to collapse
Thanks for the response - it seems it was not a problem with the ROM.
I've been working on this for about 8 hrs since the last post(!!), and I've made a lot of progress. I guess I'll just post it here in case someone comes across this question, though maybe not in scope of my original question.
It turns out my custom rom cyanogenmod (CM) has a fix for the KitKat modification built in. From the command line, as root, as long as I use /mnt/media_rw/sdcard1 to access the external secondary storage (my sdcard), everything works fine. Apps don't seem to mind that /storage/sdcard1 is mostly readonly.
I tested several non-rooted apps (e.g. doubleTwist), and noticed that they were able to write to various locations on my sdcard, always as user:group 1023:1023, ie MEDIA_RW. So the CM fix works. Note that you DO NOT have to install SDFix Apps or anything like that, or modify /etc/permissions/platform.xml. My original goal had been to get TitaniumBackup to start using my sdcard1. What I had to do was, as root, creat /mnt/media_rw/sdcard1/Backup/TitaniumBackup, set the owner and permissions correctly, and then I was able to switch to that directory in Titanium Backup (note, you have to use the Android system back button to go up a level when navigating the directories in Titanium Backup).
Also, It's important if you are using ext4 file system for your sdcard1, that it actually be ext4, not ext2, or CM doesn't recognize it. I used AParted to format it to ext4.
Finally, seems like FolderMount is great app for actually USING your sdcard1, once it's writable. I used FolderMount to redirect sdcard0/DCIM to sdcard1/DCIM, and now my camera is saving to the sdcard.
Sorry for maybe stating so much obvious info, but thought it might help some newcomer like myself - also seems like there's not a really good guide out there for users on how to work with the KitKat restrictions. Seems like with a Mod'd ROM like CM11, maybe nothing has changed(??) I am too new to Android to know the answer.

Related

[Q] change mountpoint of sdcard so that it goes to the actual sdcard

Does anyone know how to update the mount points so that when I insert a microsd card it is mounted to the mnt/sdcard folder? I still would like to be able to use the internal storage though. Maybe it can be mounted someplace else.
I ask because I would like to backup my apps to the SD card using Titanium backup and Astro. Backing up my apps to the internal memory makes no sense. Especially when you are trying to move Angry Bird saved games between devices.
I did the opposite when I was running the CM7 on the GTablet: all the ROMs mapped sdcard to the internal memory while CM7 had it the way you want it. I didn't need an SD card for the GTab, so suffice to say, I updated it to change it back so all my apps would work again.
Anyway, you need root, and all you have to do is find /etc/fstab and change the mount points to where ever you want them. On the GTab, I just switched emmc and sdcard around. This worked on Android 2.3, so I assume its the same for 3.x. I don't have my Transformer with me here at work or I'd look to make sure.
IMPORTANT: Make sure you make a system backup before you mess with it, cause you could mess up the file and then nothing will mount on start up, so proceed at your own risk.
http://forum.xda-developers.com/showthread.php?t=1122710
Last page has a script you can use or you can use the app method, I think it is towards the end of the 2nd page, its a 1.99 app but works fine and survives reboots
EDIT: Post 38 and 41

[Q] /data purpose?

Caution, ROM flashing newbie.
Hey,
I'm currently considering to flash a ROM on my S5830 (running Cyanogen 7.2 Stable currently) and one of the steps is to mount /data, which I thought could be done in mounts&storage in CWM recovery. My question is what the purpose of this is. Maybe because ROM related data is stored there? Thanks!
P.S. Yes, I have searched the answer for this and no, I couldn't find it.
I'm asking this, so I'll know what its use is, so I'll hopefully can solve related problems elsewhen.
The /data partition contains much of the data pertaining to user settings, contacts, applications, etc. If you were to perform a factory reset, this is the partition in your phone's internal storage that gets wiped clean.
Hmm, okay, but why is /data completely empty when I open it with ES File Explorer (hidden files shown)? And why is this unmounted by default if it's this important? Thanks in advance!
Sent from my GT-S5830 using xda app-developers app
That's because your file manager needs root permission to list the contents. In Terminal Emulator, run "su root" followed by "ls /data", and you'll see lots of stuff in there.
Sent from my SPH-D710
YellowApple said:
That's because your file manager needs root permission to list the contents. In Terminal Emulator, run "su root" followed by "ls /data", and you'll see lots of stuff in there.
Sent from my SPH-D710
Click to expand...
Click to collapse
Many thanks for your quick and clear help, appreciate it.
Only one more thing: why is it unmounted by default, and if it's unmounted, why can I still view it? I think I misunderstand what mounted is.
Currently playing with my Ace S5830 running Cyanogen 7.2 Stable
Remcotjuuh said:
Many thanks for your quick and clear help, appreciate it.
Only one more thing: why is it unmounted by default, and if it's unmounted, why can I still view it? I think I misunderstand what mounted is.
Currently playing with my Ace S5830 running Cyanogen 7.2 Stable
Click to expand...
Click to collapse
Good question. Do you have a link to the directions you're trying to follow for reference? The flashing directions are likely referring to mounting the /data folder/partition outside of the normal Android OS (i.e. via ClockworkMod or from a computer). By default /data should be mounted and accessible from Android (assuming you're using root privileges with your file manager or the "ls" command), else you won't have access to most of your contacts, settings, etc.
YellowApple said:
Good question. Do you have a link to the directions you're trying to follow for reference? The flashing directions are likely referring to mounting the /data folder/partition outside of the normal Android OS (i.e. via ClockworkMod or from a computer). By default /data should be mounted and accessible from Android (assuming you're using root privileges with your file manager or the "ls" command), else you won't have access to most of your contacts, settings, etc.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1808856
Here's it. The installation procedure can be found under Installation procedure, and mount data really is emphasized. And yes, I can mount /data in CWM recovery under mounts and storage, which gives me the impression it's unmounted now. Actually, the only thing which I CAN unmount is /cache. The others, /data, /system, /sdcard and/ sd-ext, all have the option to be mounted.
And after enabling root access in ES file explorer I indeed could view /data
Yup. Since Droid Ace v2 has files that go in /data (you can tell by the presence of a "data" folder in the root of the ROM's zip if you open it up with a file manager), it needs /data to be explicitly mounted prior to install, since it has to put stuff in there. Most ROMs I've used (like CyanogenMod) only use the /system partition (unless you install gapps).
Not sure why the update script doesn't do the mounting, but since I'm no developer (yet), there might be a very legitimate reason for that.
Sent from my SPH-D710
YellowApple said:
Yup. Since Droid Ace v2 has files that go in /data (you can tell by the presence of a "data" folder in the root of the ROM's zip if you open it up with a file manager), it needs /data to be explicitly mounted prior to install, since it has to put stuff in there. Most ROMs I've used (like CyanogenMod) only use the /system partition (unless you install gapps).
Not sure why the update script doesn't do the mounting, but since I'm no developer (yet), there might be a very legitimate reason for that.
Sent from my SPH-D710
Click to expand...
Click to collapse
That makes sence. One more thing then. As my previous ROM was Cyanogen, I also installed gapps, but I can't remember I mounted /data at that time, and installation simply succeeded. Any thoughts? Maybe because I installed gapps after flashing Cyanogen.
Sorry for the late response. It's possible that the Google Apps update package *does* mount /data in its scripts; I have yet to look into it. Or perhaps it does some intermediate thing where they plop some temp installer somewhere and have Android run said installer. I'll have to find that out
Sent from my SPH-D710
I think I got it. I thought that when flashing the ROM one of the lines said mounting /data, so that could have been part of the scripts.
Sent from my GT-S5830 using xda app-developers app

[Q] Has anyone found an App to SD solution?

I've looked through the big development thread and haven't found a clear answer but has anyone found an app to sd solution that works?
This stupid SdCard / ExtSdCard arrangement is making me pull my hair out. I just realized my titanium backups weren't really backups since they were being stored on my internal memory.
I managed to change my backup folder and free up some space by moving all my backups to the SD card, but for some reason I cannot move apps to SD through Titanium or any other app I've tried.
Does anyone know how to do this? Is there a setting in titanium I need to change or is this just something we have to deal with forever short of flashing a custom rom?
SDCARD binary
Galahad_Knight said:
I've looked through the big development thread and haven't found a clear answer but has anyone found an app to sd solution that works?
This stupid SdCard / ExtSdCard arrangement is making me pull my hair out. I just realized my titanium backups weren't really backups since they were being stored on my internal memory.
I managed to change my backup folder and free up some space by moving all my backups to the SD card, but for some reason I cannot move apps to SD through Titanium or any other app I've tried.
Does anyone know how to do this? Is there a setting in titanium I need to change or is this just something we have to deal with forever short of flashing a custom rom?
Click to expand...
Click to collapse
I've found the real problem, but not the solution.
My Relay runs ICS. It is rooted, and you have to root to even touch any of this. The phone has a binary, /system/bin/sdcard that controls the internal memory and your SDcard. now, I have found that if you are rooted, you can chmod this binary (or use rooted ES File explorer to remove all executable properties) so that it can no longer run, then reboot. then you can run, as superuser "mount -o rw,bind /mnt/extSdCard /mnt/sdcard"
Seems great... Except vfat doesn't like to be bound in such a fashion, and you quickly lose write access and it starts mangling your files.
vfat just doesn't seem to work for us in this case. I've changed mine back, and reformatted my SDcard to be NTFS and mounted with paragon NTFS/HFS, which has completely stabilized my filesystem. only problem is, I can't get this to mount -o bind worth a damn.
I'm toying with the idea of reformatting my SDCard part vfat and either part NTFS or EXT4. maybe I get get the phone to natively recognize ext4 for the sdcard (even if I have to create a script myself)
keypoints I've found in this process:
1. the sdcard binary only allows access to 1023 files at once on either the SDcard, or the memory block it is using as the SDcard. too many pictures in your gallery? so sorry... can't load them all.
2. the physical device for your sdcard is /dev/block/mmcblk1. the partitions are mmcblk1p* (starting with 1)
3. the phone will not allow the sdcard binary to be killed manually. removing the executable permission and then rebooting the phone seems to be the only way to get it to stop.
4. vfat is prone to errors, and android seems to love screwing with the card. getting off vfat seems to be crucial to this process.
As you've gotten no other replies, and this is a gigantic concern for me as well, I'm going to keep working on this myself, in the hopes that I can get the phone to actually use the SDcard the way we hope it can be used.

Problems with TWRP Backup - unable to mount sd/ext

I've been searching both this forum and the net generally and not found an answer to my specific problem so I'm hoping someone can help.
I'm trying to swap out my ROM, I'm currently running CM 11 nightly but I'm getting endless FCs with apps so thought I'd try something different.
When I try to run the nandroid backup with TWRP v2.7.0.1 the backup fails every time with the error E: unable to mount '/sd-ext'
Can anyone advise? Thanks
tht looks like external sd card.
Try changing location for your backup to internal memory or make sure you got SD card plugged in to SD slot.
you may also try command on terminal emulator (or via adb shell):
ln -s /storage/emulated/0/ /sd-ext/
it will create symbolic link named sd-ext in root of your system and it will point to internal storage (if I am not mistaken, from now on it should not matter if you select internal or external storage as target for your backup - it will end up as internal anyways)
Sent from my TF300T using XDA Free mobile app
Thanks, the backup was to be created on the internal SD card, but you are right it is almost certainly a problem with the external card. I'm unable to mount either the dock SD or micro SD cards in TWRP - the options are just greyed out and can't be selected.
I can't get either card to mount when I boot to system ether I have noticed. I've tried formatting them as FAT32, EXFAT and NTFS and no dice so I'm wondering if this is a KK issue - they both worked flawlessly when I was running PA and Omnirom JB ROMs.
I've managed to find a workaround - I've flashed CWM and have been able to do a nandroid backup with that - but I still can't mount either the micro SD or dock SD cards with CWM or in system when I flashed KatKISS ROM - and of course now I can't use any old TWRP nandroids I have from JB ROMs without reflashing TWRP. I'd also rather be running TWRP ultimately if I can so it would be good to get to the bottom of what is causing this issue.
Not quite sure what the command line you suggested does, but I'm guessing it won't be useful with the problem as it stands now?
sorry for late reply as I was out of internet lately.
that command creates /sd-ext/ folder that acts similar to shortcut to intertnal sdcard
any call for /sd-ext (for example: cd /sd-ext) will end up on internal sdcard.
That wont help with accessing your external sdcard (as this was main issue here) - it would merely fool installer to 'think' it is working on external sd while it was still on internal.
Sent from my TF300T using XDA Free mobile app
Thanks for your help. I've had endless troubles which ultimately ended in a hard brick during a failed flash of the stock ROM. I'm waiting for a replacement motherboard - something wasn't right with the old board anyway, it doesn't seem that it was just ROM issue. Hopefully when it comes I'll find that it wasn't a hardware issue associated with the SD cards as well.

[Completed] [Question] Writing to external sd card Specifically with ES File Manager!

I have a Sprint Galaxy Note $ Running Stock og5 Rom Rooted via Beast Mode TWRP then Play update, then flashed to Plazma Kernel. I have modified the /etc/permissions/platfom.xml file to include Group Id media_rw in the write to external storage permission and mounted the /mnt/media_rw/estSDcard as r/w in the root explorer portion of ES File Manager and it seemed to work fine for as long as I can remember but now if I try to copy or paste or send something to /storage/extSDcard it is created asychrously and ends up in the LOST.dir folder after a simple unmount remount or reboot or SDcard pull. Other apps are having the same problems like app backup restore and Btitorrent and others when trying to write directly to extSDcard I even went ass far as adding sdcard_all to the aforementioned gid permission set. It seems like such an obvious thing that has been overlooked by develpoers of the rom. I can create masting folders "no asychronously' if I do so buy navigating to /mnt/media_rw/extSDcard rather than /storage/extSDcard and they'll last but not all programs will allow that directory in their settings. Furthermore ES download Manager won't function with either directory and will not allow their app backup file to be saved the /mnt directory. only /0 or /storage/extSDcard.
I have exhausted my abilities with this and have no answer also It seems to be a new problem, and I haven't done anything I can think of to cause this. Partition table is 55000mb Fat32 17009mb ext4 journal partition on the extSDcard. Any Ideas?
Below you can see The before and after of unmounting and remounting my sd card resulting in Populated Lost.dir and loss of created folders also you can see the way that all nav methods resultu in same permission set when checked with a root explorer "total Commander"
wELL i DON'T KNOW WHY BUT REFORMATTING THE SD CARD TO A SINGLE FAT 32 VOLUME SOLVED THE LEAK. i FIRST TRIED AN ALTERNATE SD CARD WITH A SIMILAR PATITION TABLE (EXT2/FAT32) BUT HAD THE SAME PROBLEMS EXCEPT THE DATA WOULD SIMPLY BE GONE INSTEAD OF IN THE LOST.DIR FOLDER. i HAVE YET TO IMPLEMENT THIS TO MY PRIMARY USE SD CARD because of the fact that I have backups and files that I need on that card from before the leak. I anticipate the same results, fingers crossed.
If ANYONE has any incite into why the partition table set up as it was would affect the retention of data in this manner please let me know.
PLEASE PLEASE let me know
Hello,
Try posting your question/issue in the ROM/kernel thread where you got them or their dedicated Q&A thread(if it has one) or even PM the developer in case its something he isn't aware of, he may want to try and solve it so his ROM has no issues.
I hope this helps. Good luck.
Droidriven said:
Hello,
Try posting your question/issue in the ROM/kernel thread where you got them or their dedicated Q&A thread(if it has one) or even PM the developer in case its something he isn't aware of, he may want to try and solve it so his ROM has no issues.
I hope this helps. Good luck.
Click to expand...
Click to collapse
Thanks, I was using stock rom though. And the caps lock was an accident, at any rate i have changed roms and the issue appeared to be a faulty sd card to begin with. I wasn't able to retain data from my reader writer to phone on my primary sd ince reformatted but was when I used a different one. Anyway thanks for the advice and I will use it if I have different questions

Categories

Resources