MTP on Ubuntu/Mint/Debian

Search This thread

mussieonlinux

Senior Member
Apr 10, 2012
64
24
With many devices not supporting mass storage anymore Android seemed to have moved from mass storage to PTP and MTP

With Windows supporting MTP by default and Mac OSX with an application there isn't any native support in Linux.
There are a few work arounds like gMTP but that didn't really work for me.
There also is another work around that requires you to edit some files.
To make it easier for others I wrote a little bash script, that does most for you.


Step 1 : sudo apt-get install mtp-tools mtpfs
Step 2 : Plugin your device
Step 3 : Open up a terminal
Step 4 : Type in : “mtp-detect”
Step 5 : Write the PID and VID down, you will need this later
Step 6 : disconnect your device
Step 7 : Download the script and execute it by sudo ./mtp (don't forget to make it an executable first)
Step 8: Follow the instructions on screen and after it's done reboot and plugin your device
Step 9: Use the command "android-connect" to mount your device and "android-disconnect" to dismount

It's not much, but I hope it helped someone.
Please let me know if it worked for your device/distro.
Original post

Tested and working on the P3110 and P5110.

EDIT 1:
(First) time mount can take up to 1-2 minutes, have had where it would mount in a few seconds, others half a minute. Be patient. :)
 

Attachments

  • mtp.tar.gz
    804 bytes · Views: 4,426
  • mtp.png
    mtp.png
    59.1 KB · Views: 2,700
Last edited:

wd5gnr

Senior Member
Dec 20, 2010
460
130
Houston
With many devices not supporting mass storage anymore Android seemed to have moved from mass storage to PTP and MTP


Tested and working on the P3110 and P5110.

Thanks for this. I think I have tried all this before and it has not worked, but will try again. A few things come to mind though. First, I think you have to turn USB debugging off, right? There is another thread where several of us are able to see the tablet, but not really get any files. Also there is a way to get the tablet to share PTP or MTP and that changes things too (PTP lets me see the top level but no subdirectories).

Will report back if this works or not.
 

mussieonlinux

Senior Member
Apr 10, 2012
64
24
I think USB debugging has to be on, at least for my phone. Mine is always on on all my devices.
Yeah you can see it in the file manager (1 for each SD card) with MTP but you can't access the files.
I am not sure about the PTP.. However for the MTP I just made a new folder in on my other SD card named extSD since MTP shows all directories of both sdcards in one directory.
 

wd5gnr

Senior Member
Dec 20, 2010
460
130
Houston
I think USB debugging has to be on, at least for my phone. Mine is always on on all my devices.
Yeah you can see it in the file manager (1 for each SD card) with MTP but you can't access the files.
I am not sure about the PTP.. However for the MTP I just made a new folder in on my other SD card named extSD since MTP shows all directories of both sdcards in one directory.

Nope doesn't work with or without USB debug. I think the issue may be due to some problem with mtp-tools on 64 bit Linux. Are you running 32?

The mtpfs mounts but any attempt to list the mounted directory just hangs.
 

mussieonlinux

Senior Member
Apr 10, 2012
64
24
I am using 64bit, did you do the reboot and android-connect? If you are using nautilus you wont see your device under "Devices". You will see it above your filesystem.

Can you tell me what isn't working?
 

Attachments

  • xda1.png
    xda1.png
    27.2 KB · Views: 1,366
Last edited:

wd5gnr

Senior Member
Dec 20, 2010
460
130
Houston
I am using 64bit, did you do the reboot and android-connect? If you are using nautilus you wont see your device under "Devices". You will see it above your filesystem.

Can you tell me what isn't working?

Well I'm using Kubuntu so no Nautilus. And I'm just looking at the mount point. My udev rules already have an entry for the mtd device. I also grabbed the latest libmtd and built it from source.

The fuse mount seems to work but any ls on the mount point just hangs forever.

Very strange.
 

ufizo

Senior Member
Sep 12, 2012
81
30
Pune
www.arpitsingh.in
At times like this I miss ubuntu :D

On my Arch (+XFCE), I use gMTP (uses mtpfs ofcourse). Most of the times it works, and then there are times when it is a pain in the a##. Gets stuck, does not respond, fails to copy what not.

I find the only reliable way is using adb.
Gosh! I push and pull everytime! :silly:
 

mussieonlinux

Senior Member
Apr 10, 2012
64
24
yeah, after a couple of days I found it not very stable at all, so I too switched over to ADB, it's not the fastest method. But we gotta get around, don't we?
 

denialnw10

Senior Member
Apr 7, 2006
100
16
I am also waiting for a permanent fix... Just switched back to Ubuntu from Windows 8 Preview, and I love it!!!

The only issue I have at the moment is the fact that I cannot connect directly to the PC from the Tab, although transfer speeds are better by removing the memory card and inserting it into the computer directly. Would be nice to use Rhythmbox to manage my MP3s.

I've tried a few solutions and nothing seems to work fully. I'll give the ideas mentioned above a try.
 
  • Like
Reactions: spette

fuchini

Member
Jul 20, 2012
31
2
Hello, this worked greatly on my ubuntu machine. Would this work on an ArchLinux headless PC? I'm willing to try it out if this doesn't mess anything up.
 

aterfodelse

Senior Member
Apr 11, 2012
51
4
aterfodelse@aterfodelse-Lenovo-B480:~$ android-connect
fuse: bad mount point `/media/GT-P3100': Transport endpoint is not connected
aterfodelse@aterfodelse-Lenovo-B480:~$

As you can see above, i tried this for P3100. Can someone tell me what am i doing wrong here? I really want to handle my device from Ubuntu 12.04.
 

carepack

Senior Member
Sep 21, 2010
1,147
756
hi there,

in newer kernel - at this thime for example debain testing jessie - is kio-mtp implemented. this compinent load your nexus 4 mtp device autmotically like in windows. can access device via filemenager without doing steps in console before. in long time support distribution - example debian stable wheezy - this is not implemented yet. you can compile own your own to get this working

kio-mtp is for kde
gnome-vfs with mtp is for gnome
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    With many devices not supporting mass storage anymore Android seemed to have moved from mass storage to PTP and MTP

    With Windows supporting MTP by default and Mac OSX with an application there isn't any native support in Linux.
    There are a few work arounds like gMTP but that didn't really work for me.
    There also is another work around that requires you to edit some files.
    To make it easier for others I wrote a little bash script, that does most for you.


    Step 1 : sudo apt-get install mtp-tools mtpfs
    Step 2 : Plugin your device
    Step 3 : Open up a terminal
    Step 4 : Type in : “mtp-detect”
    Step 5 : Write the PID and VID down, you will need this later
    Step 6 : disconnect your device
    Step 7 : Download the script and execute it by sudo ./mtp (don't forget to make it an executable first)
    Step 8: Follow the instructions on screen and after it's done reboot and plugin your device
    Step 9: Use the command "android-connect" to mount your device and "android-disconnect" to dismount

    It's not much, but I hope it helped someone.
    Please let me know if it worked for your device/distro.
    Original post

    Tested and working on the P3110 and P5110.

    EDIT 1:
    (First) time mount can take up to 1-2 minutes, have had where it would mount in a few seconds, others half a minute. Be patient. :)
    2
    hi there,

    in newer kernel - at this thime for example debain testing jessie - is kio-mtp implemented. this compinent load your nexus 4 mtp device autmotically like in windows. can access device via filemenager without doing steps in console before. in long time support distribution - example debian stable wheezy - this is not implemented yet. you can compile own your own to get this working

    kio-mtp is for kde
    gnome-vfs with mtp is for gnome
    1
    I am also waiting for a permanent fix... Just switched back to Ubuntu from Windows 8 Preview, and I love it!!!

    The only issue I have at the moment is the fact that I cannot connect directly to the PC from the Tab, although transfer speeds are better by removing the memory card and inserting it into the computer directly. Would be nice to use Rhythmbox to manage my MP3s.

    I've tried a few solutions and nothing seems to work fully. I'll give the ideas mentioned above a try.