sdcard folder is a file? - General Questions and Answers

Hello,
I have recently flashed a new ROM on my Android phone and I'm having problems with the internal storage.
The folders /sdcard and /mnt/sdcard are missing, instead there are 0B files with the same names in their place.
I have already figured out the blockdevice for the internal SD, since it works flawlessly in recovery mode.
So I thought I could remove the files, replace them with respective folders and modify the fstab file to mount the right device on boot.
On restart, things returned to their original state, the folders i created were gone and again replaced with empty files.
The Android version is Nougat 7.1.2, rooted with Magisk.
Do you have any idea where I could look for a script/procedure that is responsible for reverting the changes?
Might it have something to do with Magisk root and it's systemless nature or could it be something else?
Thanks in advance,
V.

Related

How to write file / folder to internal memory on rooted Android device

Hello,
I tried with root explorer, all seems ok, but after reboot created files and folders in internal memory disappear.
Where on the Internal Memory are you placing them? If their in / they will disappear when the phone reboots because the root filesystem is actually a ramdisk with /system, /data and /cache mounted on them and symlinked to fit. (I believe.)
i see so ... i want to write some files in /data/data/com_adobe_flashplayer/lib/ as wrote here http://forum.xda-developers.com/showthread.php?t=1359506 but after reboot they are gone
UN.TIGRU.NET said:
i see so ... i want to write some files in /data/data/com_adobe_flashplayer/lib/ as wrote here http://forum.xda-developers.com/showthread.php?t=1359506 but after reboot they are gone
Click to expand...
Click to collapse
That's because the package for "com_adobe_flashplayer" doesn't exist. It seems that the path might have gotten changed by the board for looking to much like a URL. Replace the underscores with periods and you should be good to go. Sorry it took so long to get back to you.
Hope I solved your problem
Alternatively, the post you linked contains a update you can flash through recovery that should fix your problem easily.

Cannot Resort Backups From d/l'd via ROM Manager After CM 10.1

So I was on CleanROM 5.6 and wanted to give 10.1 a shot. I made a backup and downloaded it to my computer via the ROMManager tool. I ran into 2 issues with 10.1 and decided I'd try again later, so I wanted to flash back to my CleanROM backup that I'd just made. Whether via ROMManager or going straight into recovery the process says it can't open the path to the file. I say the path, as this has occurred with the zip image on internal memory and when I've tried on the SD card.
Soooo, now I'm pretty stuck. Thoughts? I felt like it must have related to the new 4.2 file structure but again, this was an issue whether my zip was on internal memory or the card.
Thanks,
BH
The exact process is:
installing [path]
finding update package.
opending update package.
e: cant open [path] (bad)
installation aborted
CWM says it's leaving a log file but I am not seeing it.
Sounds like your filesystem is like this: "/sdcard/0" and if it is, then do the following:
use Root Explorer or a similar program and navigate to /sdcard/0/ press Menu should give you an option for Multi-Select, select all the folders/files in the /0/ directory, hit menu or down on the bottom choose Move (again depends on the browser) back up one level to the main /sdcard/ directory, and hit Paste. It will tell you there is files with the same information (because the ROM rebuilt the file structure) choose Merge, and let it do its thing. Depending on how many files you have, it may take a little while, just be patient.
Click to expand...
Click to collapse
taken verbatim from here:
http://rootzwiki.com/topic/37316-protip-42-and-recoveries/
I'm going to give it a shot now. I wouldn't have thought this would be an issue restoring since the zip was accessible and I even tried flashing from internal mem, but perhaps it's not as much as issue of reading the file as knowing where to extract the data? We'll see.
All in all, if I could just get 10.1 to stop giving me market errors (920) I'd probably just stick with that at the moment. Alas, have tried all of the interweb's solutions for that too.
Will update, thanks.
So I don't have a /0/ dir on the card, but I do have a /1/. Tried moving the contents of /1/ but it failed. May try another file explorer app (this was via CMs). Interestingly, I was able to flash a ClearnROM install zip, which is 4.1.1 based. Why would that work but the constructed backups wouldn't?
update: I can flash anything else regardless of location, and I am using the latest recovery. def seems like something specific to zip backups made/downloaded via the newest means in ROM Manager
monorailmedic said:
So I don't have a /0/ dir on the card, but I do have a /1/. Tried moving the contents of /1/ but it failed. May try another file explorer app (this was via CMs). Interestingly, I was able to flash a ClearnROM install zip, which is 4.1.1 based. Why would that work but the constructed backups wouldn't?
update: I can flash anything else regardless of location, and I am using the latest recovery. def seems like something specific to zip backups made/downloaded via the newest means in ROM Manager
Click to expand...
Click to collapse
Well if the rom zip is on /sdcard or /extsdcard then it will flash fine. If your backups are on /sdcard/1/ then that's literally the same as /0/. Recovery is looking for your Nandroid backup on /sdcard but it's not there, it's actually been unnecessarily moved to /sdcard/1/ if I'm understanding you correctly. You will not be able to restore a nandroid until you get those files moved back to the proper file path.
Sent from my SCH-I535 using xda app-developers app
SlimSnoopOS said:
Well if the rom zip is on /sdcard or /extsdcard then it will flash fine. If your backups are on /sdcard/1/ then that's literally the same as /0/. Recovery is looking for your Nandroid backup on /sdcard but it's not there, it's actually been unnecessarily moved to /sdcard/1/ if I'm understanding you correctly. You will not be able to restore a nandroid until you get those files moved back to the proper file path.
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
I have a similar problem with my file system after flashing from 4.2 back to 4.1 that has me confused.
I flashed to a TW rom after being on CM10.1, and I was using the most recent TWRP when I originally flashed CM10.1. I had the usual problem that everybody seems to have being that the "0" folder was located on my card. I copied the fold over to my normal sdcard folder (unfortunately I used root browser instead of root explorer, which made this much more painful as it does not have the "merge" ability. Root Explorer - accept no substitutes)
After doing the merge though, I have 2 problems.
#1 - My external SDcard is now listed under "storage."
#2 - There is an Sdcard there called "sdcard0 as well as a "extSdCard" in this storage folder with all the same information as the original "0" folder that was on the internal sdcard. Also a bunch of folders named UsbDriveA, UsbDriveB, etc.
Why did this happen? And how should I set up my folders so that it behaves properly? In other words, what does a normal file system look like?
SlimSnoopOS said:
...Recovery is looking for your Nandroid backup on /sdcard but it's not there, it's actually been unnecessarily moved to /sdcard/1/ if I'm understanding you correctly. You will not be able to restore a nandroid until you get those files moved back to the proper file path...
Click to expand...
Click to collapse
So this is where I am confused, does the zip not contain all of the appropriate backup data within itself, and it is looking elsewhere (in the wrong path) for backup data? This seems odd based on the whole idea as well as the size of the file. If this is not the case, when why is whatever scripting is included in the backup looking for an absolute and not a relative path to the data? It should always be relative to the location of the zip file itself.
I really want to try and understand this.
PeterGunz said:
I have a similar problem with my file system after flashing from 4.2 back to 4.1 that has me confused.
I flashed to a TW rom after being on CM10.1, and I was using the most recent TWRP when I originally flashed CM10.1. I had the usual problem that everybody seems to have being that the "0" folder was located on my card. I copied the fold over to my normal sdcard folder (unfortunately I used root browser instead of root explorer, which made this much more painful as it does not have the "merge" ability. Root Explorer - accept no substitutes)
After doing the merge though, I have 2 problems.
#1 - My external SDcard is now listed under "storage."
#2 - There is an Sdcard there called "sdcard0 as well as a "extSdCard" in this storage folder with all the same information as the original "0" folder that was on the internal sdcard. Also a bunch of folders named UsbDriveA, UsbDriveB, etc.
Why did this happen? And how should I set up my folders so that it behaves properly? In other words, what does a normal file system look like?
Click to expand...
Click to collapse
See my attached photo for what your file system should look like. I'm using ES File Explorer and that's my file system.
What do you mean your external SDcard is listed under Settings/Storage? Both of mine are listed, internal storage is first then my external sd card is second. Care to screenshot what you mean?
monorailmedic said:
So this is where I am confused, does the zip not contain all of the appropriate backup data within itself, and it is looking elsewhere (in the wrong path) for backup data? This seems odd based on the whole idea as well as the size of the file. If this is not the case, when why is whatever scripting is included in the backup looking for an absolute and not a relative path to the data? It should always be relative to the location of the zip file itself.
I really want to try and understand this.
Click to expand...
Click to collapse
If you're using CWM, it saves your backups for internal sd card in: /sdcard/CWM/backup and blobs. For your external sd card, it's saved /extsdcard/CWM/backups and blobs. If you flashed any AOSP 4.2 rom, it moves EVERYTHING from your /sdcard/ path to /sdcard/0. See the difference? Example, your music should be in this path /sdcard/Music but instead it's been moved to /sdcard/0/Music on AOSP 4.2. I get what you're saying how it should be looking for where the zip is BUT the multi-user support completely disrupts our entire thinking of how our file system should be because one user could be "rooted" whereas the other user would be completely stock depending on who signed in. It's too early to expect this to just work since Google introduced this in 4.2. It's a take it or leave it thing.
Sent from my SCH-I535 using xda app-developers app
For a standard backup that makes total sense. My confusion is how this happens with a zip, when all of the backup data is confined to that one archive file (or at least should be).
monorailmedic said:
For a standard backup that makes total sense. My confusion is how this happens with a zip, when all of the backup data is confined to that one archive file (or at least should be).
Click to expand...
Click to collapse
When you made a backup with Rom Manager, it saved to /sdcard, since flashing 4.2, everything on /sdcard moved to /sdcard/1/... Rom Manager and any app honestly would have issues when the file location has changed suddenly and without its express permission. It's not the fault of Rom Manager that it can't find the file to restore your backup. Having an updated TWRP or CWM is supposed to help prevent the /sdcard contents from being merged to /sdcard/0, its not supposed to continue looking for the "new" file destination.
SlimSnoopOS said:
See my attached photo for what your file system should look like. I'm using ES File Explorer and that's my file system.
What do you mean your external SDcard is listed under Settings/Storage? Both of mine are listed, internal storage is first then my external sd card is second. Care to screenshot what you mean?
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Sorry, I can see what I said was confusing.
On the root of my device, among the usual folders, there is one named "sdcard" and another named "storage."
In the "sdcard" folder, all of the folders were empty; however, there is a folder named "0" which contained all of my sdcard contents from my internal sdcard.
In the "storage" folder from the root of my file system, it resembles what you have in your screenshot, except there are no asec and obb folders. In the sdcard folder is a replica of the 0 folder. It contains everything that was in my original internal sdcard. The extsdcard contains everything normally found on my external sd card.
When download something with the stock browser, it defaults to the sdcard folder on the root of file system.
I've attached some screenshots. Let me know what you think and thank you for the help.
PeterGunz said:
Sorry, I can see what I said was confusing.
On the root of my device, among the usual folders, there is one named "sdcard" and another named "storage."
In the "sdcard" folder, all of the folders were empty; however, there is a folder named "0" which contained all of my sdcard contents from my internal sdcard.
In the "storage" folder from the root of my file system, it resembles what you have in your screenshot, except there are no asec and obb folders. In the sdcard folder is a replica of the 0 folder. It contains everything that was in my original internal sdcard. The extsdcard contains everything normally found on my external sd card.
When download something with the stock browser, it defaults to the sdcard folder on the root of file system.
I've attached some screenshots. Let me know what you think and thank you for the help.
Click to expand...
Click to collapse
Oh! This is actually funny, we've been looking at the same thing from two different viewpoints. I see what you mean, /Storage and /sdcard are perfectly normal when you see them on the absolute root file system: "/". I always go to /mnt, that's where I have my file explorer default to open when I launch the app. Sdcard0 = sdcard, and various apps will use the names interchangeably. I have exactly the same paths /sdcard and /Storage, and I do see /Storage/sdcard0 and /Storage/extsdcard along with the same empty USB Drive folders. This is just how the "/" directory is split up. There isn't a duplication of files taking up more space than necessary, it's just showing you another path to get to those files. To reiterate, on "/" you can get to your sdcard contents in at least three paths: /mnt, /sdcard, and also /Storage/sdcard0
All that matters is the /sdcard/0 aka /Storage/sdcard0/0 is GONE. Which, in your original post you said no longer exists correct?
Sent from my SCH-I535 using xda app-developers app
I am still not understanding how there is a problem with executing a zip file that contains all the backup data. It doesn't matter where I move this zip file, as it seems it should be all inclusive of the backup data. Why does it matter the path of this file? What is the script looking for during restoration? Shouldn't it be looking within the archive?
I'm sorry, I feel like a tool, but again, I'm obviously missing some very basic part of what is happening when the file is accessed. As it is all inclusive, why is recovery looking for content anywhere outside of the archive?
monorailmedic said:
I am still not understanding how there is a problem with executing a zip file that contains all the backup data. It doesn't matter where I move this zip file, as it seems it should be all inclusive of the backup data. Why does it matter the path of this file? What is the script looking for during restoration? Shouldn't it be looking within the archive?
I'm sorry, I feel like a tool, but again, I'm obviously missing some very basic part of what is happening when the file is accessed. As it is all inclusive, why is recovery looking for content anywhere outside of the archive?
Click to expand...
Click to collapse
Backups cannot be flashed like other ZIP files. They need to be restored using the restore function of your recovery. The problem is that the CWM restore function is looking for its backups where it puts them (not surprisingly). Android 4.2 moved them to another location and you need to move them back.
SlimSnoopOS said:
Oh! This is actually funny, we've been looking at the same thing from two different viewpoints. I see what you mean, /Storage and /sdcard are perfectly normal when you see them on the absolute root file system: "/". I always go to /mnt, that's where I have my file explorer default to open when I launch the app. Sdcard0 = sdcard, and various apps will use the names interchangeably. I have exactly the same paths /sdcard and /Storage, and I do see /Storage/sdcard0 and /Storage/extsdcard along with the same empty USB Drive folders. This is just how the "/" directory is split up. There isn't a duplication of files taking up more space than necessary, it's just showing you another path to get to those files. To reiterate, on "/" you can get to your sdcard contents in at least three paths: /mnt, /sdcard, and also /Storage/sdcard0
All that matters is the /sdcard/0 aka /Storage/sdcard0/0 is GONE. Which, in your original post you said no longer exists correct?
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Correct!
You helped me solve my problem. I was so confused for awhile there.
What should I rename my sdcard after copying everything over from "0"?
I just flashed back to 4.2.1 (AOLP) and I cannot find the contents of my internal sdcard anywhere. In fact, when I check storage on the system settings it only shows that I have a little over 12gbs total space on the internal sdcard. The 8gb I have on TW on the internal sdcard are not recognized by the rom. Any thoughts?

Solved. [Q] The death of me (wiped ext sdcard and file recovery doesn't work)

I have a Sprint Galaxy s3. I was on a touchwiz based ROM. I flashed over to a CM. 10.2 ROM. I knew that my internal storage would be wiped so i put all my goods on the external sd card. When I booted up into the CM rom,I went to my file manager. I went to the "Storage" folder and saw a folder called Emulated, as well as the sdcard0 and sdcard1 folders. I noticed that the emulated folder had the "0" folder inside of it. I deleted it, not knowing the tragedy that would happen. Then I noticed the real ExtSdcard was empty. I died when this happened. Why did this happen? I tried downloading a file recovery, Recuva to be exact, but it couldn't recover anything as well as Recover files, Stellar Phoenix and Dumpster, .Are there better file recoveries that anyone can recommend? Am I SOL ? If anything had to be recovered first, it would be my music. I haven't put anything on the ext Sdcard since it would possibly overwrite the data of my precious files. Is there anything else I can do to get them back?:crying:
Edit- I found another recovery tool that worked at least for my music. I'm so glad it worked.

[Q] Lollipop vs /sdcard ... permission denied

Hi guys,
I need some hints on what has changed from Android < 5 to Lollipop when it comes to internal storage.
I have booted my Nexus 4 running Lollipop into ClockworkMod recovery and mounted the internal storage.
Then I did an "adb push" of files that I have backed up before to restore those onto the internal storage.
Once that was done I have opened a shell and changed ownership back to media_rw:media_rw and also
checked POSIX permissions to be correct.
Basically this is what I have done so many different times on different Android devices.
Once I have booted back into the system ... I could not access any of those files and directories.
I assume that there was something added on top of plain POSIX access control. A SELinux thing or something
like ACL or stuff, or maybe a database referring to files stored on /sdcard.
Anyway what can I do in recovery mode to make manually copied files and directories available in the system?
Any help would be appreciated!
Thanks in advance!
/Al

Please help I'm in big trouble.. stuck in TWRP, Wiped, can't find recovery files.

I was using the resurrection remix rom, and needed to do an update, so I did what it said and downloaded the files I needed, saved them to my micro SD card in a folder I created and named "root". I did the wipe and erased everything following the instructions on that page, and now I'm trying to install the files so I can flash them and that root folder is not showing up! Nothing is showing up in my sd directory. I have two directories; one says sdcard, and the other is named external_SD. Inside the external_SD folder is a LOST.DIR file that's completely empty. Inside the sdcard folder is a TWRP file which is also empty and I'm freaking out now because I don't know how to get to my SD card. Everything is saved to my sd card and I have no access to the files I need and my phone is wiped now and doesn't have a rom installed and I have no idea or way to get a rom installed now. I don't know what to do and I'm panicking. If anyone knows what to do in this situation I will be eternally grateful.
I was able to get into download mode and use Odin to install factory firmware. This issue has been fixed.

Categories

Resources