[Q] Lollipop vs /sdcard ... permission denied - Android General

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

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.

[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] Recovering Data from HTC One M7 after factory reset

Hello Everyone,
I've been trying for more than a week now to recover data (photos, contacts, messages) from my HTC One M7 after I accidentally hit the factory reset button (was in a hurry to play squash and was fumbling around till the disaster happened!) :crying: Worse of all, I have no backups :crying::crying: My phone has no SD card, only the internal memory. It runs on Android 5.0.2 and has been rooted. I have busybox and TWRP installed on the phone. I have Android SDK and cygwin on my PC.
Initially, I tried to mount the phone's internal memory as a drive on Windows so I can do a scan of it using a data recovery tool. But I wasn't successful as MTP seems like the only option and there's no way to diable it. Even the disable MTP option inside TWRP doesn't make the drive accessible via USB! I have tried various recovery software available online but none of them can see my phone thanks to the stupid MTP!
Finally, I tried the steps on this thread precisely
http://forum.xda-developers.com/gal...de-internal-memory-data-recovery-yes-t1994705
Have managed to copy the whole memory block of the phone using
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
and created a mmcblk0.raw file which I can open using Disk Internals (Linux Reader). I found only the data that currently exists on the drive after the factory reset. Tried to access the image with TestDisk (as shown here - http://www.df.lth.se/~jokke/androidfilerecovery/) and I cannot see any of my old files there too! (I'm trying the Deeper Search Option now)
I'm not sure if 'dd' command copies the disk sector-by-sector. I think any data recovery software can scan the disk image and find the old files as long as I can create a sector-by-sector image of the phone's internal drive. If not, any way to mount the internal drive as a USB drive on Windows could work too! Can anyone please help me with this?
Many thanks in advance!!!!

Android file heirarcy questions?

I have attempted to search this but always come up a little short. I trying to understand the filing system Android uses. I have a Moto G (2015) running Marshmallow with an 16 gig external memory card set to portable.
I use ES Explorer to view the filing structure. Using the tree I select the "/ device" option. I see several folders and files. One is "sdcard". I understand this is not the memory card, but seems exactly like the "storage emulated 0" folder listed in the tree's "0" option. It does not however appear to be the same folder as listed in the "/device/storage/emulated" folder. What' up with that?
I also think the external memory card is located in "Device/storage" Is that true?
I am really having a time wrapping my head around this. Thanks for any help.
To get the actual locations of the mount points just run the command "mount" in a terminal or ADB shell. In many places there are just symlinks to the actual mount points, which looks like the SD card does exist in different places. E.g. /sdcard is typcially only a link to the mount point of the SD card.
If you run the command "ls -l" in a directory you can see where such a symlink is actually pointing to.
I don't have access to my Moto G3 right now. Writing this on another device running CM.
Here the sdcard is natively mounted at /mnt/media_rw/sdcard1 and then again virtually with a fuse layer at /storage/sdcard1. Everything else are just symlinks. I would assume that on a Moto G3 running CM it's the same. On stock rom probably a bit different.
Anyway with the commands mentioned above you can easily check this.
Maybe this will help.
http://android.stackexchange.com/qu...d-by-the-many-locations-of-the-virtual-sdcard
u42671 said:
To get the actual locations of the mount points just run the command "mount" in a terminal or ADB shell. In many places there are just symlinks to the actual mount points, which looks like the SD card does exist in different places. E.g. /sdcard is typcially only a link to the mount point of the SD card.
If you run the command "ls -l" in a directory you can see where such a symlink is actually pointing to.
I don't have access to my Moto G3 right now. Writing this on another device running CM.
Here the sdcard is natively mounted at /mnt/media_rw/sdcard1 and then again virtually with a fuse layer at /storage/sdcard1. Everything else are just symlinks. I would assume that on a Moto G3 running CM it's the same. On stock rom probably a bit different.
Anyway with the commands mentioned above you can easily check this.
Click to expand...
Click to collapse
Thanks but your answer is a little above my paygrade. I was mainly wanting to check if an app had stored data on an internal storage and minor stuff like that.
riggerman0421 said:
Maybe this will help.
http://android.stackexchange.com/qu...d-by-the-many-locations-of-the-virtual-sdcard
Click to expand...
Click to collapse
Thanks.
That does help a little bit.
With ES explorer:
When I open "Device /", I see a lot of folders and such.
When I open "Device / storage", I see three folders, One seems to the external memory card, emulated, and self.
When I open "device / storage / emulated", it is empty.
From the ES explorer tree if I select the 0 option, it appears to open "Device/ storage / emulated / 0", that includes what appears to be a bunch of folders.
In the first scenerio, the emulated folder is empty.
In the second scenario, the emulated folder has at least folder folder (0).
Why is that?
Also when I select the 0 from the ES explore option, then, back up one level to "emulated" the folder appears to empty.
Why is that?
Thanks again.

sdcard folder is a file?

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.

Categories

Resources