Data exchange via USB

When plugged to USB older devices act as expected and pop up as memory devices. Under Windows they get a drive letter.

Since Android seems to be really attracted to Microsoft, newer devices as the Galaxy Sx do not support anymore this expected behavior. Reasons for that point to data security, Those devices support instead of the commonly used memory device behavior MTP. MTP is the Microsoft media transfer protocol (alternatively the Picture Transfer Protocol PTP can be selected). Under Windows those devices pop up as multimedia device where no drive letter is assigned. This has a side effect, most application can not save a file to the device. So two steps are required store the file somewhere and then use the file manager to move it to the device.

MTPZ, the Microsoft Zune Extension to MTP that requires authentication between both devices.

mtp under linux

Under Linux the library libmtp needs to be installed libmtp. libtmp comes with simple commands as mtp-detect that should work before going ahead. If this works, maybe with some struggling behavior ("Reading in zero packet after header" and LIBMTP panics) the next step can be taken. Linux is able using libmtp to communicate to such devices without mounting them and using the mtp protocol. gmtp is a graphical front end for it.

Mount mtp devices to file system

Instead of using a special way to communicate with them its nicer to mount them in the filesystem.

Various programs exist for that.

All use fuse so check if /etc/fuse.conf has uncomment the following line:


Originally mtpfs got used, but the newer jmtpfs works much better. other programs are simple_mtpfs and go-mtpfs

jmtps , mtpfs and all the others make use of libmtp and fuse.

To mount as root or user having permission to /mnt/sgs:

jmtpfs -o allow_other /mnt/sgs

mtpfs -o allow_other /mnt/sgs

go-mtpfs /mnt/sgs

simple-mtpfs /mnt/sgs

To unmount fusermount -u /mnt/sgs/

If it fails then one reason might be that the device already got managed by the desktop environment and is therefore busy (Having too many managers is always a problem). In the gui there might pop up two icons one named the device the other one called mtp. Unmount the mtp and do the mounting command again.

Persistent device name for MTP devices

Check if a /dev/libmtp-* device is created when it is plugged in. To get a persistent file name a udev rule can be created that creates a symlink as /dev/sgs. The deatils can be found using udevadm monitor that shows where the device is recognized and then udevadm info -a -p /sys/devices/pci000<and the rest>

So add all modifications to a new file with a high number, so it gets processed late when the device is plugged in /etc/udev/rules.d/99-sgs.rules:

      ACTION!="add", GOTO="sgslibmtp_rules_end"
ENV{MAJOR}!="?*", GOTO="sgslibmtp_rules_end"
ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860",\
SYMLINK+="sgs", GROUP="plugdev", MODE="0660"   \

Run udevadm control --reload-rules to make the above effective and then replug the phone a constant /dev/sgs name should now appear.

Automatically mount mtp devices to file system

But to mount it automatically a program needs to be launched

Edit /etc/fstab that needs:

      jmtpfs /mnt/sgs fuse users,noauto,allow_other 0 0


users instead of user is required since root mounts it and a regular user unmounts it.

It seems to be necessary to add:


to /etc/fuse.conf so I did this as well.

Then it can run as: mount /mnt/sgs/ Now the udevrule needs to run this command

      ACTION!="add", GOTO="mylibmtp_rules_end"
ENV{MAJOR}!="?*", GOTO="mylibmtp_rules_end"
ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", \
SYMLINK+="sgs3", GROUP="plugdev", MODE="0660"    \
RUN+="/bin/mount /media/sgs"


You must unlock the screen to get access to the device

Linurs Servernest startpage