I am running the latest stock Oxygen OS version (11.2.10.10.LE15AA), rooted with Magisk. Somehow the internal /sdcard directory got unmounted and now I cannot save anything to the user storage because it doesn't exist. I could not even take screenshots because it saves by default to /sdcard/DCIM/Screenshots which doesn't exist now, so I apologize for having to take photos of a screen (the first is from terminal, the other 2 are from ES File Explorer). However, when I run "ls -la /" as superuser in a terminal window it lists sdcard. Does anyone know how to fix this? How do I re-mount /sdcard and get it recognized again?
eudemonics said:
I am running the latest stock Oxygen OS version (11.2.10.10.LE15AA), rooted with Magisk. Somehow the internal /sdcard directory got unmounted and now I cannot save anything to the user storage because it doesn't exist. I could not even take screenshots because it saves by default to /sdcard/DCIM/Screenshots which doesn't exist now, so I apologize for having to take photos of a screen (the first is from terminal, the other 2 are from ES File Explorer). However, when I run "ls -la /" as superuser in a terminal window it lists sdcard. Does anyone know how to fix this? How do I re-mount /sdcard and get it recognized again?
Click to expand...
Click to collapse
Try to reboot to recovery and factory reset
Fixed the /sdcard unmounted error!
What finally ended up working was flashing the Oxygen OS zip in TWRP and rebooting without root. I noticed my internal storage was restored along with all the files in it — but then when I rebooted to bootloader to re-root the device with a Magisk-patched boot.img (booting into Android once as temp root with "fastboot boot magisk_patched.img", then running the Magisk app and selecting "direct install" to patch boot.img for permanent root) the /sdcard unmounted error came back! So I disabled all the newer Magisk mods I had installed, rebooted, and I have /sdcard again along with root. Yay! Factory reset was going to be my next attempt if that didn't work though.
Related
So I rebooted to recovery and I push a file into /sdcard
after I shell, I check it's only file in there!! So then I reboot and then adb shell again when phone is regular mode and I don't see that file
Where did I push the file when in recovery? I can't find it next time I reboot to recovery then did LS, the file is gone! Can I delete that file or its lost/hidden or what's going on?
Im not even going to read the whole thing. If u pushed the file and u can't figure out how to reboot from recover just pull battery and restart
Sent from my SCH-I500 using XDA App
You need to mount your sd card to /sdcard.
The file was stored to / on the temporary ramdisk. Do "mount -a" in shell first.
pulser_g2 said:
You need to mount your sd card to /sdcard.
The file was stored to / on the temporary ramdisk. Do "mount -a" in shell first.
Click to expand...
Click to collapse
Thanks for the good info! SO basically the file I pushed over was removed upon rebooting correct? I just don't want that file to be on the ramdisk or sdcard anywhere since the /sdcard was not mounted.
So i've made a mistake. I forgot to download GAPPS but i've already done a factory reset and installed a new rom. I cant seem to mount the usb storage trough clockwork recovery. Is there a way to push the zip file to the device?? Or what should i do?
Thanx
xclusiv8 said:
So i've made a mistake. I forgot to download GAPPS but i've already done a factory reset and installed a new rom. I cant seem to mount the usb storage trough clockwork recovery. Is there a way to push the zip file to the device?? Or what should i do?
Thanx
Click to expand...
Click to collapse
If you only forgot gapps you can restart, the ROM and the phone will work fine you just won't have Google apps. Once it's on you can just copy the file like usual and return to recovery and flash it
Sent from my Galaxy Nexus using xda premium
Good question though. What IF he didnt flash the ROM, how do you get a file on the SDcard if you cant mount it in recovery?
adb push ./"filename.zip" /sdcard
Phone will boot just fine w/o GAPPS.
But you can just use adb push <FILE> <DIRECTORY>
for example:
Code:
adb push gapps.zip /sdcard/
Thanx for the help guys =)
This happens to me all the time. The Mounts section of CWM select "mount as USB" drive. Windows should see this drive and transfer away.
merge5 said:
This happens to me all the time. The Mounts section of CWM select "mount as USB" drive. Windows should see this drive and transfer away.
Click to expand...
Click to collapse
GN internal storage can't be mounted as USB - not even in recovery.
The only way I've found to push/pull files in CWM on the GN is over ADB. If the files in /sdcard/ don't appear, go into mounts and storage, and mount /data. Then try again.
/sdcard/ is nothing more than a symlink to /data/media.
I transfer files over ADB with
'adb push update.zip /data/media/'
no need to mount /data before.
just reboot open up your computer and youll see the gnex just transfer the gapps to your sd card and then reboot in recovery to flash
cmstlist said:
GN internal storage can't be mounted as USB - not even in recovery.
The only way I've found to push/pull files in CWM on the GN is over ADB. If the files in /sdcard/ don't appear, go into mounts and storage, and mount /data. Then try again.
Click to expand...
Click to collapse
Good point. I stand corrected. That was how I did it on my OG Droid. Sorry for the confusion.
bk201doesntexist said:
/sdcard/ is nothing more than a symlink to /data/media.
I transfer files over ADB with
'adb push update.zip /data/media/'
no need to mount /data before.
Click to expand...
Click to collapse
I'm not sure why but CWM on my phone used to auto mount /data and now it doesn't anymore. So to see anything from adb in recovery, I now have to go to mounts first.
Sent from my Galaxy Nexus using Tapatalk
cmstlist said:
I'm not sure why but CWM on my phone used to auto mount /data and now it doesn't anymore. So to see anything from adb in recovery, I now have to go to mounts first.
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
What cwm version are you on, for instance?
Latest CWM touch as of today, and also tried it with latest CWM non-touch.
Incidentally I just bumped into a caveat of transferring files to the GN in recovery mode. The permissions are set strangely when you push files over ADB in recovery, and as a result when booted into the OS I was unable to rename any of the pushed files/folders or put new files in. Since the DCIM directory was one that I'd pushed over, new photos weren't saving. And I did not have permission to change permissions.
This is pretty much a brute force method - so I rebooted into recovery again, mounted /data, did adb shell, cd sdcard, and then:
chmod -R 777 *
And upon booting back into the OS, everything works properly again.
I know that messing with permissions is usually a dangerous thing. My logic was that anything stored in /sdcard is supposed to be a file that any app would be allowed to access as long as it has SD permissions - it's been that way in every version of the OS through to 4.0.
But anyway, if there's something I should do to decrease the "unsafeness" of this situation, please advise me. I guess in theory this would give a malicious app permission to execute code from /sdcard, which would make me more vulnerable?
EDIT: Okay more to report. To see the permissions properly when booted into the OS, you have to go into /data/media rather than /sdcard (same directory but permissions appear differently).
When I went in there and typed ls -n, I found that all the files I had pushed in recovery have UID & GID of 0. All files I had created afterwards had UID & GID of 1023. That explains everything. The owner is root for files that came from ADB in recovery, and media_rw for files created in the OS.
I can use chown, but it looks like the version of chown that comes with busybox does not have -R recursion implemented. Hrm. Aha! In CWM, chown does support -R. And we're off to the races. So from recovery I did:
cd /data/media
chown -R media_rw.media_rw *
cmstlist said:
Latest CWM touch as of today, and also tried it with latest CWM non-touch.
Incidentally I just bumped into a caveat of transferring files to the GN in recovery mode. The permissions are set strangely when you push files over ADB in recovery, and as a result when booted into the OS I was unable to rename any of the pushed files/folders or put new files in. Since the DCIM directory was one that I'd pushed over, new photos weren't saving. And I did not have permission to change permissions.
This is pretty much a brute force method - so I rebooted into recovery again, mounted /data, did adb shell, cd sdcard, and then:
chmod -R 777 *
And upon booting back into the OS, everything works properly again.
I know that messing with permissions is usually a dangerous thing. My logic was that anything stored in /sdcard is supposed to be a file that any app would be allowed to access as long as it has SD permissions - it's been that way in every version of the OS through to 4.0.
But anyway, if there's something I should do to decrease the "unsafeness" of this situation, please advise me. I guess in theory this would give a malicious app permission to execute code from /sdcard, which would make me more vulnerable?
EDIT: Okay more to report. To see the permissions properly when booted into the OS, you have to go into /data/media rather than /sdcard (same directory but permissions appear differently).
When I went in there and typed ls -n, I found that all the files I had pushed in recovery have UID & GID of 0. All files I had created afterwards had UID & GID of 1023. That explains everything. The owner is root for files that came from ADB in recovery, and media_rw for files created in the OS.
I can use chown, but it looks like the version of chown that comes with busybox does not have -R recursion implemented. Hrm. Aha! In CWM, chown does support -R. And we're off to the races. So from recovery I did:
cd /data/media
chown -R media_rw.media_rw *
Click to expand...
Click to collapse
that would explain it: i always use /data/media, didn't find any permission issues yet. thanks.
Just put on this jelly bean ROM, and when trying to save files from dropbox onto the internal sd it says "error". Audiogalaxy, another app I use, won't allow me to save copies of my songs to the internal SD either. I feel like there's a setting somewhere that's preventing me from save files onto the internal sd, but can't find it. In ICS I was able to find it, pretty sure in Settings -> Storage, but no dice in Jelly Bean.
Any help?
I have you made sure settings>developer options>protect USB storage is not checked. That's where I'd start.
Just fired up Wugs toolkit 1.4 and set full file read/write/execute permissions to all those directories (or at least tried to). Still nothing.
Wanted to update that I was able to rename the DCIM folder to DCIM1 and now it can save camera pics to the phone. I still can't open up a dropbox file due to "storage full or unavailable".
I think you have an issue. You shouldn't have to grant any extra permissions for the apps to write to the SDcard, as there isn't actually an SDcard or partition for it. It's just a symlink to /data/local, a virtual "SDcard".
All my apps work fine writing/reading the "SDcard".
Have you made sure settings>developer options>protect USB storage is not checked. That's where I'd start.
o_z0ne said:
Have you made sure settings>developer options>protect USB storage is not checked. That's where I'd start.
Click to expand...
Click to collapse
Yessir this is not checked.
EDIT: also noticed that when I take a picture, it doesn't save it to the phone. The pic just disappears after it's taken.
Try fixing permissions and checking the permissions/owner on /sdcard/ and /data/media (where the /sdcard folder is symlinked from). There have been lots of threads about sdcard permissions and Jelly Bean,.
ex:
http://forum.xda-developers.com/showthread.php?t=174832
http://forum.xda-developers.com/showthread.php?p=2696762
Similar:
http://forum.xda-developers.com/showthread.php?p=21746289
Other possible solutions are suggested in links.
Just fired up Wugs toolkit 1.4 and set full file read/write/execute permissions to all those directories (or at least tried to). Still nothing. There's gotta be something I'm doing wrong here, I can't be the only guy who has this jelly bean rom installed and isn't using a microSD card.
papabri said:
There's gotta be something I'm doing wrong here, I can't be the only guy who has this jelly bean rom installed and isn't using a microSD card.
Click to expand...
Click to collapse
That's probably true, considering the GNex doesn't have a MicroSD slot .
haha yes true.
Wanted to update that I was able to rename the DCIM folder to DCIM1 and now it can save camera pics to the phone. I still can't open up a dropbox file due to "storage full or unavailable".
Solved this issue by doing this:
Reflash stock. Hold off on restoring data/media. There seems to be a problem with it in v1.4.
{{ WugFresh }}
I since put back on the JB rom and have full access with no issues. My issue was when I restored my backup to the phone, the permissions were messed up.
What you probably had was an ownership issue, not permissions.
http://forum.xda-developers.com/showpost.php?p=22970837&postcount=14
cmstlist said:
Latest CWM touch as of today, and also tried it with latest CWM non-touch.
Incidentally I just bumped into a caveat of transferring files to the GN in recovery mode. The permissions are set strangely when you push files over ADB in recovery, and as a result when booted into the OS I was unable to rename any of the pushed files/folders or put new files in. Since the DCIM directory was one that I'd pushed over, new photos weren't saving. And I did not have permission to change permissions.
To see the permissions properly when booted into the OS, you have to go into /data/media rather than /sdcard (same directory but permissions appear differently).
When I went in there and typed ls -n, I found that all the files I had pushed in recovery have UID & GID of 0. All files I had created afterwards had UID & GID of 1023. That explains everything. The owner is root for files that came from ADB in recovery, and media_rw for files created in the OS.
I can use chown, but it looks like the version of chown that comes with busybox does not have -R recursion implemented. Hrm. Aha! In CWM, chown does support -R. And we're off to the races. So from recovery I did:
cd /data/media
chown -R media_rw.media_rw *
Click to expand...
Click to collapse
So if you bump into this again, try chown in ClockworkMod in ADB shell over USB.
I just uprgraded to the lollilop gpe OTA. Everything is working as normal, camera, Infrared, light, wifi, LTE radio, etc... I am also rooted.
However, ES File Explorer is still unable to modify the contents of the External-SDCard. I tried doing a simple copy operation from the internal-SDCard to the External-SDCard and there was a prompt that came up (looks like it is from android OS and not from the application) which asks me to select the "root folder" of the External-SDCard.
Following that prompt, I get to the screen where I should click on the "External SDCard" icon on the left of the screen, but the when I do that, the application named "Documents" reports that it has stopped and then it sends me back to the paused copy operation in ES File Explorer and then that operations fails...
Anyone have any clue if this is supposed to work straight out of the "box"? Or do I need to download kernel patches or go modify platform.xml again like in 4.4.4 GPE?
Thanks!
r2d-two said:
I just uprgraded to the lollilop gpe OTA. Everything is working as normal, camera, Infrared, light, wifi, LTE radio, etc... I am also rooted.
However, ES File Explorer is still unable to modify the contents of the External-SDCard. I tried doing a simple copy operation from the internal-SDCard to the External-SDCard and there was a prompt that came up (looks like it is from android OS and not from the application) which asks me to select the "root folder" of the External-SDCard.
Following that prompt, I get to the screen where I should click on the "External SDCard" icon on the left of the screen, but the when I do that, the application named "Documents" reports that it has stopped and then it sends me back to the paused copy operation in ES File Explorer and then that operations fails...
Anyone have any clue if this is supposed to work straight out of the "box"? Or do I need to download kernel patches or go modify platform.xml again like in 4.4.4 GPE?
Thanks!
Click to expand...
Click to collapse
FAQ
Google Play Edition 5.0.1
SdCard
Q.)
The sdcard not being visible via PC is annoying.
Is there any fix for this yet?
A.)
Yes, here is a work-around
Install Terminal Emulator then type:
Code:
su
restorecon -FR /data/media/0
Some say the KK sdfix works also
clsA said:
Q.)
The sdcard not being visible via PC is annoying.
Is there any fix for this yet?
A.)
su
restorecon -FR /data/media/0
Click to expand...
Click to collapse
Thanks. Although the above says it resolves an issue with "The PC" not being able to see the sdcard, and my issue is with an android application (ES File Explorer) not being able to write to the sdcard, I still went ahead and ran the suggested command and although the command succeeded, the android application still can't write to the sdcard...
although it won't solve all your problems with writing to external SD card on the HTC One Lollipop, you can fix the crashing of the "Documents" app you described by making sure your micro SD card has a label (name): put the sd card in a sdcard reader in your PC/Laptop and give it a name.
Hi. Yes, you are correct I found out about the label being blank causing the crash and adding a label to the external sdcard partition fixed the crash in ES File Explorer. With the crash now gone i was able to grant ESFile Explorer write access to the entire external SDCard, and the app is now working flawlessly.
I also found this thread: https://code.google.com/p/android/issues/detail?id=67570#c4444
So, based on that thread's discussion, it looks like the app developers of any app that needs/wants write access to the external sdcard just need to change their applications to start using the new API, just like the ESFile Explorer guys did.
adb commands
Try running these adb commands one after the other
adb shell
su
restorecon -FR /data/media/0
Sent from my Viper Bitten M8
Hello everyone,
So after flashing TWRP 3.0.2-0 and installing a custom rom, TWRP stopped showing .zip files. I've googled the issue to maybe get an idea of a workaround and some people have suggested to put the file in "0" folder or the media folder. I've also tried mounting the system partition, I'm not sure if its supposed to take effect right away or after a reboot, if its after a reboot it unmounts.
I'm on HTC M8, marshmallow, using TWRP 3.0.2-0.
Thank you.
That's a weird issue to be related to TWRP
If earlier you choosed flash image you need to revert the selection to flash zip
Sent from my HTC M8 using XDA Labs
Sorry, I do not understand. Are you referring to the way I flashed twrp? This is the command I used "fastboot flash recovery twrp-2.8.x.x-xxx.img".
I'm not sure if this is at all related, I have duplicate file structures, /Data/Media/0, everything is the same as in my internal storage.
I've created a folder to put the zip into so I can recognize it and I still cannot see the zip file in twrp. I've checked both directories. I've even tried putting the zip on my SD card, nothing, twrp just does not see the zip.
SpaceGold said:
Sorry, I do not understand. Are you referring to the way I flashed twrp? This is the command I used "fastboot flash recovery twrp-2.8.x.x-xxx.img".
I'm not sure if this is at all related, I have duplicate file structures, /Data/Media/0, everything is the same as in my internal storage.
I've created a folder to put the zip into so I can recognize it and I still cannot see the zip file in twrp. I've checked both directories. I've even tried putting the zip on my SD card, nothing, twrp just does not see the zip.
Click to expand...
Click to collapse
can you put the twrp.img in the same directory as zip files and see if you can see it in the recovery install option
Sent from my HTC M8 using XDA Labs
I'm not sure what fixed it, I made a back up and restored the phone, twrp now sees the zips. I doubt what I did fixed anything as the restore probably has 0 impact on twrp, but it works.
Thanks for the help.
SpaceGold said:
I'm not sure if this is at all related, I have duplicate file structures, /Data/Media/0, everything is the same as in my internal storage.
Click to expand...
Click to collapse
For your reference ... when you have this issue ...
Just run commands when connected to PC while OS is running
adb shell
su
restorecon -FR /data/media/0
exit
then reboot, this should fix it
ckpv5 said:
For your reference ... when you have this issue ...
Just run commands when connected to PC while OS is running
ad shell
su
restorecon -FR /data/media/0
exit
then reboot, this should fix it
Click to expand...
Click to collapse
May i ask for an explanation
THANKS IN ADVANCE
Sent from my HTC M8 using XDA Labs
ahmed.ismael said:
May i ask for an explanation
THANKS IN ADVANCE
Sent from my HTC M8 using XDA Labs
Click to expand...
Click to collapse
That's usually happens when the update from Lollipop to Marshmallow done with firmware flashing only, not the OTA.
After marshmallow firmware is flashed on top Lollipop firmware, upon reboot the system recreated the new emulated internal storage .. then we'll see we have a "0" folder in the internal storage. Internal storage is the new emulated storage but the "0" folder is the old emulated storage.
To fix it, we can manually copy all data in "0" folder to internal storage then delete the "0" folder
or use the above command to let the system do it automatically.
The extreme one is format data (not wipe) in TWRP so the data/media/0 is recreated brand new.
ckpv5 said:
That's usually happens when the update from Lollipop to Marshmallow done with firmware flashing only, not the OTA.
After marshmallow firmware is flashed on top Lollipop firmware, upon reboot the system recreated the new emulated internal storage .. then we'll see we have a "0" folder in the internal storage. Internal storage is the new emulated storage but the "0" folder is the old emulated storage.
To fix it, we can manually copy all data in "0" folder to internal storage then delete the "0" folder
or use the above command to let the system do it automatically.
The extreme one is format data (not wipe) in TWRP so the media/0 is recreated brand new.
Click to expand...
Click to collapse
As usual extremely helpful
Thank you
Sent from my HTC M8 using XDA Labs
ckpv5 said:
For your reference ... when you have this issue ...
Just run commands when connected to PC while OS is running
ad shell
su
restorecon -FR /data/media/0
exit
then reboot, this should fix it
Click to expand...
Click to collapse
Is this usable on an already bootable rom? I guess it is since you did say to reboot. Just being cautious haha.