Strange read/write behavior through USB on Linux

scarlion

Member
Mar 15, 2015
49
3
28
i'd like to be able to read/write/copy files to/from /sdcard while my phone is connected through USB to my Linux workstation running Ubuntu 12.04, but am experiencing some weird issues. i have USB debugging enabled and have authorized the computer to access the phone when i connected it the first time. when the phone connects as a Camera (PTP), i can see a SAMSUNG_Android partition show up on my workstation, but when i try to open it nothing happens... kind of just hangs there trying to load the files. if i connect the phone as a Media Device (MTP) then i again see a SAMSUNG_Android partition show up. when i open it, it will load the directory /sdcard but all of the subdirectories are empty, e.g. DCIM shows 0 items, Pictures shows 0 items, etc... all of the subfolders are empty and so i can't read anything from /sdcard except the root directory structure itself. i can copy a file from my workstation to the phone e.g. to /sdcard/Documents and it will show up in the dir listing on the workstation as well as the phone, but as soon as i reconnect the phone, the Documents directory is empty again showing 0 items, but the file i just copied to the phone is still on the phone. if i turn on private mode and reconnect the phone, then i can see the private files listed on my workstation on a second SAMSUNG_Android partition and i can read/write to that partition fine (note that i have Wanam Xposed installed and have disabled secure storage).

so basically i can't read from /sdcard through USB connection... if i want to get files off the device i have to use "adb pull" for each one

i have the /etc/udev/rules.d/51-android.rules file created with the following content:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
 

scarlion

Member
Mar 15, 2015
49
3
28
i found this: https://askubuntu.com/a/284571
after installing the updated gvfs, i can see the listing of the directories at least, and i can copy files from the device now... but i can't open files directly still. e.g. when i try to open a picture with Image Viewer, i get an error "Failed to open input stream for file"... if i try to use gnome-open from the command line i get this error:
Error showing url: Operation not supported

however, there is a PDF file i have in ./Documents/ that i CAN open directly
i have some 3GP Audio recordings in ./Recordedcalls/ that i can't open either with mplayer or totem e.g.

seems like these applications that can't open the files are just not updated enough to understand the updated MTP protocol in gvfs? evince (the PDF viewer) must have the updated MTP support, is all i can think of...

any ideas?
 
Last edited: