Since Honeycomb, Android devices have starting using MTP (Media Transfer Protocol) instead of the straight up USB Mass Storage (UMS) file transfer system – creating massive headaches for most Linux users and not a few Windows users as well.  And since it’s become the standard since Ice Cream Sandwich and the Galaxy Nexus, it’s something any Linux & Android user is going to have to be able to cope with.  Fortunately, it’s quite easy to get this working. First, you’ll need to install the MTP file system package:

$ sudo apt-get install mtpfs mtp-tools

Next you’ll need to create a static mount point for MTP attached devices:

$ sudo mkdir /media/MTPdevice
$ sudo chmod 775 /media/MTPdevice
$ sudo mtpfs -o allow_other /media/MTPdevice

If you don’t already know your device’s idVendor and idProduct, you can determine them by connecting your phone via USB and querying it using MTP.  Make sure your device is in MTP mode (PTP mode should work out of the box in Ubuntu 12.04 and up, but this only accesses your DCIM directory for your camera):

Android USB Computer connection dialog: MTP checked, PTP unchecked.

NOTE: if you can’t find the USB PC configuration under your settings, it’s possible that your phone has been set by the manufacturer or carrier to not show it.  You can use a dial code to change this settings instead. Then query your device using MTP (this example uses a Galaxy Note II):

$ mtp-detect
libmtp version: 1.1.4

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y.
   Found 1 device(s):
   Samsung: GT P7310/P7510/N7000/I9070/I9100/I9300 Galaxy Tab 7.7/10.1/S2/S3/Nexus/Note/Y (04e8:6860) @ bus 2, dev 20
Attempting to connect device(s)

As soon as the VID and PID appear you can cancel the command (CTRL-C).  If the VID and PID aren’t displayed immediately after the device is listed, MTP should eventually display “idVendor: 04e8″ and “idProduct: 6860″ in the output. Next you’ll need to add a rule to your USB system handler to properly detect and mount your device using your favourite text editor as root:

$ gksu gedit /etc/udev/rules.d/51-android.rules

Add the following, on a single line (be sure to replace <vendorId> and <productId> with the values you got from mtp-detect):

SUBSYSTEM=="usb", ATTR{idVendor}=="<vendorId>", ATTR{idProduct}=="<productId>", MODE="0666"

After you save the file and exit your editor, disconnect your phone and restart udev:

$ sudo service udev restart

Now when you connect your Android phone, tablet, etc. it should automatically mount for you at /media/MTPdevice.

MTP File Explorer Showing Mounted Phone SD Cards

You’ll need to unmount it before disconnecting it, just like any other mounted volume.  You can either unmount from Nautilus or from the command line:

$ sudo umount mtpfs

Note that go-mtpfs may be more stable and ultimately easier to use, but since it’s more difficult to set up we’ve gone with the mtpfs solution here. For those who are wondering why Google would create all this unnecessary hassle by changing up the USB access system, it’s mostly because MTP allows for simultaneous access on both the Android device and the connected PC, along with better file transfer support (ie, less file errors).


If you have your device locked (eg, which a swipe code or PIN), you’ll need to unlock it before your SD card(s) can be recognized by MTP and have it mount them for you to access locally.  

Related Posts
While Ubuntu does many things well out of the box, being able to recognize Android devices connected by USB is not one of them.  Instead the devices have to be ...
Recently I needed to install Asterisk with FreePBX on an existing Ubuntu 10.04 LTS (Lucid Lynx) 64 bit server.  Since Asterisk is really targeted at CentOS this was a bit ...
My Solutions IT offers a wide variety of telephony support and services ranging from personal use to office systems to entire call center set ups.  Whatever your telephony needs, we ...
I dislike Ubuntu's built in remote desktop service, and use x11vnc instead. Recently I was having a terrible time recently remotely accessing an Ubuntu+Gnome workstation: when I connect from a ...
GNOME has always been my go-to window manager on Linux, usually on Ubuntu.  However, it does have a few annoying quirks and deficiencies.  One of the most aggravating ones is ...
Mounting your Android’s SD Card on Ubuntu
Installing Asterisk 1.8 and FreePBX 2.9.0 on Ubuntu
Getting Shift Key Working With x11vnc and VNC
Disable Numpad Mouse Keys on Linux+GNOME Permanently