[Q] Android L, external_SD no permissions, mounted - Sprint LG G3

Running BarePOP rom, a lollipop, Android 5
My external sdcard is using ext4 filesystem, in BarRin rom I had no issues.
I think is a fuse problem, I've tried to unmount and remount card
I can access /mnt/media_rw/external_SD
I see it's mounted properly
Code:
/dev/block/vold/179:65 /mnt/media_rw/external_SD ext4 rw,dirsync,seclabel,relatime,data=ordered 0 0
/dev/fuse /storage/external_SD fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
I've tried messing with sdcard command. changed uid & gid to 1015,1023,1035
SDCARD_RW 1015 /* external storage write access */
MEDIA_RW 1023 /* internal media storage write access */
SDCARD_ALL 1035 /* access all users external storage */
Code:
[1]+ sdcard /mnt/media_rw/external_SD /storage/external_SD 1023 1023 &
tmp-mksh-4.3# ls -la /storage/
drwx------ root root 1970-01-18 21:43 USBstorage1
drwx------ root root 1970-01-18 21:43 USBstorage2
drwx------ root root 1970-01-18 21:43 USBstorage3
drwx------ root root 1970-01-18 21:43 USBstorage4
drwx------ root root 1970-01-18 21:43 USBstorage5
drwx------ root root 1970-01-18 21:43 USBstorage6
dr-xr-xr-x root root 1970-01-18 21:43 emulated
lstat '/storage//external_SD' failed: Permission denied
lrwxrwxrwx root root 1970-01-18 21:43 sdcard0 -> /storage/emulated/legacy

I'm surprised your sd even worked! We've all had to format on a computer fat32. No matter the size.
If you're on V1, install the sd card fix in the first 3 posts. Any other version it's already installed.
Selinux mode changer, also mentioned in those posts, is another option.
If neither of those work, then you may have corrupted one or both sd's.

engine95 said:
I'm surprised your sd even worked! We've all had to format on a computer fat32. No matter the size.
If you're on V1, install the sd card fix in the first 3 posts. Any other version it's already installed.
Selinux mode changer, also mentioned in those posts, is another option.
If neither of those work, then you may have corrupted one or both sd's.
Click to expand...
Click to collapse
Version TEv1, and if I didn't know to look at /mnt/media_rw/external_SD I would say it didn't work. /storage/external_SD only can be seen in terminal. All other apps don't even see it. Even root doesn't have permission to read. SElinux set to permissive. I'm wondering if it's a kernel issue. The mount looks correct. I really don't know.

Just connected to computer, sdcard show but not accessable

jcfunk said:
Just connected to computer, sdcard show but not accessable
Click to expand...
Click to collapse
Well, this is your answer. If the card doesn't work in two different devices, it is defective.

stopeject said:
Well, this is your answer. If the card doesn't work in two different devices, it is defective.
Click to expand...
Click to collapse
Lol, I connected usb to phone, mtp
sdcard is fine, if to blame the card it would be that it's formatted to ext4.

jcfunk said:
Lol, I connected usb to phone, mtp
sdcard is fine, if to blame the card it would be that it's formatted to ext4.
Click to expand...
Click to collapse
Sorry, I didn't notice that your card was formatted to ext4. However, when connected to a Windows PC you had to get a message that the card needs formatting. It shouldn't be identified as "not accessible".

stopeject said:
Sorry, I didn't notice that your card was formatted to ext4. However, when connected to a Windows PC you had to get a message that the card needs formatting. It shouldn't be identified as "not accessible".
Click to expand...
Click to collapse
Yes, so true, windows sucks. I use linux.
I binded /mnt/media_rw/external_SD to /data/media/0/sd-ext
Same thing, fuse issue. I thinking it might be selinux lable issue,
ls -Z shows unlabled. Going to look into labling, googled but didn't see any info on android

Ok, compiled stock kernel with configured with selinux user disable. Also boot disable, but if disabled at boot get security warring.
Selinux, no labels was the issue. Once diabled, the /storage/external_SD became readable

I am not familiar with a fair amount of what I've read in this thread (particularly the Linux commands and the mount points). That said, I'm in bliss pop ROM, and tried to get my podcast app o save my shows to external SD. No go. I got a toast that said android doesn't have permission to write to ext SD. Is anything listed here a fix for that?
TIA

scottspa74 said:
I am not familiar with a fair amount of what I've read in this thread (particularly the Linux commands and the mount points). That said, I'm in bliss pop ROM, and tried to get my podcast app o save my shows to external SD. No go. I got a toast that said android doesn't have permission to write to ext SD. Is anything listed here a fix for that?
TIA
Click to expand...
Click to collapse
Much of this is specific to ext4 filesystem on external sd. But is useful to understand, for the mount should be same, or at less for ex-fat.
I'm willing to help, I need some info.
What filedystem does your card have?
If you can, in terminal emulator run this command.
mount | grep SD
Then put output here. Could need to sdcard fix, depends on version of Barepop

Related

[Q] Emulated internal storage as sdcard

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

Lilipop (CM12) mounting a filesystem as root (not accessable to any other user)

I have liliopop CM12 installed on my Note3, I have a encrypted partition, which I mount using luks, I have the mount working now with out issues so the encrypted part can be ignored, if any one is interested I can explain how I did what I did and post the actual scripts used.
The problem is that if I su - from juicessh and then mount the partition the partition is mounted, but only the juice su'ed user can see it. I can log this user out and back in and still see it, but only this users sees it.
For instance
$whoami
10211
#su -
0
#exit
$whoami
10211
now if I run:
$su -l --shell /system/bin/sh -c 'mkdir /storage/sdcard2 ; chmod 777 /storage/sdcard2 ; mount -t ext4 /dev/sda1 /storage/sdcard2 ; df ; exit' ; df
Now this will show that /storage/sdcard2 is mounted when I'm root
when I'm non-root (AKA not ID 0) then I do not see the mount.
Now I login as root using sshdroid:
#whoami
root
#df
does not show sdcard2
Lastly via "Root explorer":
does not see anything mount in /storage/sdcard2 either.
So the issue I'm facing is that I can mount a partition as root and access it, but only as the user I mounted it as, in fact what even makes less sense is that root via sshdroid and root via juicessh can not see what the other user did (mount wise), though if I create a root accessible file that is fine. I used to do this is CM11 using the same commands (different mount points do to the OS change) without any issue. It is as if each root user is unique which is fine on the surface, but since I need access to this encrypted partition, only when accessing documents for work, which normally it is not mounted, but once mounted I need it to be accessible as any other sdcard. Any suggestions?
Thanks,
ERIC
Partly working
I got it partly working if I disable "Mount namespace separation", however I still have an issue that /storage/emulated/0 does not exist, until I use a program like Root Explorer, I mean it exists, but the shell script can not change to it (mount point not found exception), I'm assuming this is also something to do with Lilipop, but I'm not sure what or how to resolve it.
ERIC
Hi,
I state that they are not very knowledgeable about linux commands.
I have installed on my SM-G900F ROM cm12 and it works!
I created a second user, but it does not have root privileges.
I would like, however, to know how you can create a secono user with root privileges?
Thanks for the reply

SD Card permissions trouble

This thing has been a thorn in modding my phone ever since I rooted it - root has no read access to sdcard0 at all.
Whenever the external sdcard is mounted, root can only access sdcard1 after adding media_rw group to android.permission.WRITE_EXTERNAL_STORAGE, which works OK most of the times but there are some apps that rely on working with an external sdcard and root together unfortunately. Whenever the external sdcard is unmounted, same things happen with it - no access as root whatsoever. (user has full access)
Something of particular interest is the output of ls -l:
Code:
[email protected]_M3:/storage $ ls -l
drwxrwx--x root sdcard_r 1970-01-01 01:00 sdcard0
drwxrwx--x root sdcard_r 2015-08-10 02:48 sdcard1
[email protected]_M3:/storage $ su
[email protected]_M3:/storage # ls -l
drwx------ root root 2015-08-10 02:47 sdcard0
drwxrwx--x root sdcard_r 2015-08-10 02:48 sdcard1
[email protected]_M3:/storage #
and I don't really know where to begin to fix it. The stock ROM is doomed from the start with this it seems...
For the record; I'm using SuperSU and I have tried formatting my (2GB) sdcard to FAT32 and it didn't work.
Just restore the file tonoriginal data and use an app to do this.
Foldermount will work best.
Try this with thd help of this app ypu can read both sd cards at same time and keep game heavy data on sdcard as well
Sent from my SM-G355H using XDA Free mobile app
lolwhat file are you even talking about? Nothing has been touched there and that output of ls -l shows the permissions aren't as they're supposed to be for root.
FolderMount isn't exactly the thing I'm looking for. I need to fix permissions for root's access to the sdcard0 folder, plain and simple. For instance - I can't install Viper4Android because of this (though oddly I did manage to do it earlier, some black magic I did and don't remember lol). It wouldn't bother me if the sdcard folder in the ramdisk wasn't linked to the sdcard0 folder or if the permissions weren't tampered with and they were it seems.
I feel like as if I would have an easier time porting Cyanogenmod to my device than figuring this out...

Unable to access SD card 3rd partition

My SD card is partionned as follow :
mmcblk1p1 vfat , mmcblk1p2 ext2, mmcblk1p3 vfat. P1 is mounted by original system, p2 is mounted by link2sd and I made a script to mount p3 when needed .
Problem : p3 mountage is ok in the terminal I ran the script however I can not access the directory from other terminals or ES explorer ( where I intend to use it ).
Android version 4.3 (apparently same technic seems to works on 4.2.
2)
Any help appreciated

Help Remount Default /sdcard PATH, Please

Reasons:
0.) You know, apps like messing up internal storage.
1.) I have installed dozens of ROMs flashed with DualBoot Patcher(It's a great tool), and all of them share the same /sdcard path( /data/media/0, actually it's /raw/data/media/0 ), it's a terriable mess.
2.) Android Nougat does NOT have xposed yet, so I cannot use xposed module XInternalSD to do this.
Due to /sdcard being linked to /storage/emulated/0, I should mount -o bing $another_path to /storage/emulated/0.
What I want to do is:
remount $data_partition_mount_point/media/$my_path to /storage/emulated/0 when the phone is booting, so my system can use another path for internal storage
I want to unmount the default /storage/emulated and only to mount /storage/emulated/0 to keep /storage/emulated clean.
CAN I ?
But after too many times failed, I failed again. I CANNOT mount $my_path as Internal Storage again. It ends up with "Access Denied",or "cross-device link", or seperated permissions(not as a sdcard)
Also, I tried to modify install-recovery.sh to let my scripts execute when booting, but sepolicy denied my orders (like mkdir, mount, setenforce ). So, I run my scripts via APP "Boot Shell".
Is there anyone who know how to do this? Or, can a script change the default Internal Storage path?

Categories

Resources