Advertisement
Guest User

jmtpfs device confusion

a guest
Jun 22nd, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.04 KB | None | 0 0
  1. # JMTPFS mounts -- yes, the directory /media/android is owned by me
  2. # I am redacting the VID, PID and model name, but on my system, it does show up.
  3. user@stretch:/media$ jmtpfs /media/android
  4. Device 0 (VID=xxxx and PID=yyyy) is a ******* ***** (MTP).
  5. Android device detected, assigning default bug flags
  6.  
  7. # extsdcard is my removable storage (external sdcard)
  8. #"Internal shared device" is the system storage
  9. user@stretch:/media$ ls /media/android
  10. extsdcard  Internal shared storage
  11. # Contents of my removable storage device
  12. user@stretch:/media$ ls /media/android/extsdcard
  13. Android  contacts.vcf  documents  go-mtpfs  lost+found  music  new  something-else  something-new  yes.txt
  14. # As a test, I touch a file on the removable storage device
  15. user@stretch:/media$ touch /media/android/extsdcard/forums-test
  16. # ...and in Debian, I can see the file exactly where I'd expect it to be.
  17. user@stretch:/media$ ls /media/android/extsdcard
  18. Android  contacts.vcf  documents  forums-test  go-mtpfs  lost+found  music  new  something-else  something-new  yes.txt
  19.  
  20. # Now let's enter Android shell to check
  21. user@stretch:/media$ adb shell
  22. android:/ $ su # I enter root to access all possible devices
  23. android:/ # busybox find / -name forums-test
  24. /storage/emulated/0/forums-test
  25. #   ^emulated/0 right here is my internal system storage, not my removable device
  26. /mnt/runtime/write/emulated/0/forums-test
  27. #   ...and again
  28. /mnt/runtime/read/emulated/0/forums-test # and again
  29. /mnt/runtime/default/emulated/0/forums-test # and again
  30. /data/media/0/forums-test
  31. #   ^ This is the "real" mountpoint of the internal storage, and again, not the removable partition
  32.  
  33. # Strange, right?  Now let's see what happens when I "ls" my removable storage's mountpoints...
  34. android:/ # ls /storage/67* # FUSED external sdcard directory                  
  35. Android       documents  lost+found  something-else  sure    
  36. contacts.vcf  go-mtpfs   music       something-new   yes.txt  
  37. android:/ # ls /mnt/media_rw/* # Actual external sdcard directory              
  38. Android       documents  lost+found  something-else  sure    
  39. contacts.vcf  go-mtpfs   music       something-new   yes.txt  
  40. # Nothing, and nothing again.
  41.  
  42. #  How disappointing. Lastly, from within Android, I try the reverse: touch a file, and try to view it on Debian
  43. 1|android:/ $ cd /storage/67*
  44. android:/storage/674c7168-e937-4d84-988c-3c8078219ff2 $ ls
  45. Android  contacts.vcf  documents  go-mtpfs  lost+found  music  something-else  something-new  sure  yes.txt  
  46. android:/storage/674c7168-e937-4d84-988c-3c8078219ff2 $ touch forums-test2
  47. android:/storage/674c7168-e937-4d84-988c-3c8078219ff2 $ ls
  48. Android  contacts.vcf  documents  forums-test2  go-mtpfs  lost+found  music  something-else  something-new  sure  yes.txt  
  49. # forums-test2 was successful.  Now, to check it in Debian.
  50. android:/storage/674c7168-e937-4d84-988c-3c8078219ff2 $ exit
  51. user@stretch:/media$ ls android/extsdcard
  52. Android  contacts.vcf  documents  forums-test  go-mtpfs  lost+found  music  new  something-else  something-new  yes.txt
  53. # Nothin'
  54. user@stretch:/media$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement