We often need to access the data of an MTP USB device, like a smartphone or media player.
And almost every such handheld device is equipped with a micro, mini or type C USB port. These ports are for data transfer or for charging.
And that's when MTP comes to play its role, as a bridge between two systems.
So, in this post we'll learn about MTP and it's application. Also, how to connect those devices to a PC, running Windows or Linux.
Contents
What is MTP?
The word MTP stands for Media Transfer Protocol
although many other abbreviations exists.
So, basically a communication protocol between two different devices to transfer data back and forth. It's developed by Microsoft as a part of their Windows Media Framework.
MTP is an extension of another very similar communication protocol PTP. Which is specially for older generation Cameras and Media Players for transferring pictures.
As the term Media is stressed here, so you can think it as an optimized protocol for transferring media files such as Pictures, Videos and Music files. However, it works just as well as for other file types.
MTP USB device driver
Let's know about the driver support of various MTP devices on Windows and Linux.
Windows device driver
As MTP is developed by Microsoft, so there's no need of installing any driver on Windows Vista and later versions.
However, MTP driver support could be added on Windows XP by installing Windows Media Player version 10 or later.
It shows up as a portable device in the Windows device manager.
If your device is not showing up, then just update the mtp usb device driver on Windows 10 by double tapping on the unrecognized portable devices.
Linux driver
On Linux, MTP support is provided by libmtp, the open source implementation of MTP protocol.
However, only libmtp is not enough to connect a USB MTP devices on Linux. A proper backend like Gvfs or kio-mtp is also required.
So, if you don't have the proper MTP related tools, install them with apt on any Debian based Linux distribution.
sudo apt-get install gvfs-backends gvfs-bin gvfs-fuse gvfs-daemons
It's managed by, gvfsd-fuse
and you just have to find the mount directory. For that few basic commands will be sufficient.
mount | grep 'gvfsd-fuse'
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
From the above command, you've got an idea that you can access the files on Linux under the /run/user/1000/gvfs
directory.
You can see the directory path of the MTP device, a bit weird naming though.
MTP USB device on Android
Almost every android device features both PTP and MTP for transferring files to and from a PC. You may need to enable it, depending on your vendor's preset.
So, if your phone is not being detected as an android MTP device, then you might just need to enable it.
After connecting the device to a PC with the USB cable, drag down the notification panel. You will see a notification about how you want to connect your device to your PC.
Then just enable the Transfer Files option from the selection menu.
Then You can access the files of the android device from your PC.
Accessing the files
You can use any file manager like Windows Explorer and accessing the files.
It's just plug and play on Windows 10, could be accessed by Windows Explorer as and external device, screenshot below.
If all the required libraries and backends are installed, MTP is also just a matter or plugging in the device on Linux.
An example below with the Gvfs backed, using the PCManFM-Qt file manager.
So, you can notice that the mtp://
protocol is up here in the file manager's path bar, which is not known to many applications.
But you can access the files with other applications if you use the proper path. Check the Linux driver section above to get a proper path location.
Conclusion
MTP is widely adopted among portable devices like Digital cameras, mp3 players, digital video player and most Android devices.
However, MTP is very different from its counterpart USB mas storage, which is a block device. It could be the only way to connect some portable devices to a PC. So comes with its own set of problems, like only one file operation could be done at any given moment.
But there's a distinct advantage of MTP, any file rarely gets corrupted during transfer. Even you pull out the USB cable in middle of the operation.
Hope you've got a fair idea of MTP USB device and it's drivers. Here you can know more details about this protocol.
david says
You can use in Linux the jmtpfs for mounting.
sokai says
MTP files transfer is sooo slow: have an look at https://github.com/google/adb-sync
Arnab Satapathi says
It's a very feedback, thanks!