1

I have a Nexus 4 with Android 5.0.1. I copy a file doing the following:

  1. I reboot to bootloader
  2. Boot using insecure boot.img: fastboot boot boot.img
  3. Pushed a file: adb push IMG_20140710_105128.jpg /sdcard/DCIM/Camera/
  4. Set permissions and ownership as the other files using adb shell chmod ... and adb shell chown ....

See sample:

-rw-rw-r-- root     sdcard_rw  2033519 2014-07-10 10:51 IMG_20140710_105128.jpg
-rw-rw-r-- root     sdcard_rw  2684444 2014-12-04 16:08 IMG_20141204_160833.jpg
-rw-rw-r-- root     sdcard_rw  2271545 2014-12-06 16:14 IMG_20141206_161444.jpg

I reboot normally and go to a Terminal Emulator and type ls -la in the same directory. I get "Permission denied" when trying to list the file I copied (IMG_20140710_105128.jpg) and is unreadable under all programs.

lstat './IMG_20140710_105128.jpg' failed: Permission denied
-rw-rw-r-- root     sdcard_rw  2684444 2014-12-04 16:08 IMG_20141204_160833.jpg
-rw-rw-r-- root     sdcard_rw  2271545 2014-12-06 16:14 IMG_20141206_161444.jpg

What is happening? Why is this doing this? I have root access to modify everything by using the boot insecure method. Are permissions changing when I reboot normally? Any ideas? It happens with all files I push. It doesn't matter the partition where I put it. I tried to do ls -la as root after rebooting normally and I got the same error.

1

During recovery mode, adb will be running as root so any file you push will have root as owner and group. Once your device boots up, you cannot see those files because they are not under media_rw and sdcard_r.

  • If this is truly the cause, could you edit your answer and explain how you would fix this? – Ryan Conrad Jan 1 '15 at 2:03
0

I fixed it by pushing the files into /sdcard/DCIM/Camera/ not as root

  • But I fixed it in that way and was an answer to the question, was a solution to the problem. – hongo Dec 25 '14 at 23:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.