How do i automount Android MTP devices?

Forum Forums New users New Users and General Questions How do i automount Android MTP devices?

  • This topic has 6 replies, 6 voices, and was last updated Feb 6-3:10 pm by rokytnji.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #18475
    Member
    hcp

      Hi all!

      I have an Android phone i’d like to mount as soon as it’s plugged in. I can manually mount it with jmtpfs without issues (by running “jmtpfs /path/to/any/empty/directory”), and unmount as well (“fusermount -u /path/to/mounted/directory”), but i haven’t found any simple, graphical-interface-based way to do those tasks (neither manual nor automatic).

      I’m currently running antiX 17.3.1 32-bits Full, on the default desktop settings (rox-iceWM). It’s running on two Acer Aspire PCs, a 9410 (from 2005, 32-bit only) which has antiX installed to hard disk and isn’t fresh (has a few extra things installed here and there), and a 5737z (from 2009, 64-bit) which is running antiX from a live USB to serve as my test system. The USB device used for the installation on the 9410 is different from the one used as the live USB on the 5737z (but it is the same 32-bit ISO), and is completely fresh. Both PCs have the same automount issue. For the record, regular USB sticks automount just fine. Also, i do have Lubuntu 18.04 installed on the 5737z’s hard disk, which is capable of automounting the MTP device; i’m only using it to check that the automount issue happens on a fresh antiX install.

      What should i do?

      #18476
      Forum Admin
      anticapitalista
        Helpful
        Up
        0
        ::

        I think you need gvfs-backends installed.

        Philosophers have interpreted the world in many ways; the point is to change it.

        antiX with runit - leaner and meaner.

        #18477
        Moderator
        caprea
          Helpful
          Up
          0
          ::

          There’s spacefm and you could install gmtp, a graphical frontend.
          Member kernelpanic made a menuentry for the phone
          https://www.antixforum.com/forums/topic/android-phones-not-recognized/#post-12794
          You can do this by adding his line to the menu-file in control-center–>icewm-preferences–>menu

          #18479
          Anonymous
            Helpful
            Up
            0
            ::

            gvfs-backends and PCManFM would probably do the trick.
            Another easy possibility would be to use udiskie.

            #18480
            Anonymous
              Helpful
              Up
              0
              ::

              http://ignorantguru.github.io/spacefm/spacefm-manual-en.html

              spacefm –desktop

              While managing the desktop, SpaceFM’s volume monitor will also be running, meaning that if configured to do so, it will automount devices.

              If you want SpaceFM always running in the background, ready to quickly open windows and automount volumes, but don’t want it to manage the desktop, start a daemon instance of SpaceFM:

              spacefm -d

              #18482
              Member
              hcp
                Helpful
                Up
                0
                ::

                Thank you all for the pointers.

                I’ve installed gvfs-backends, but it doesn’t seem to be doing anything? I haven’t found udiskie to be of much help, either (i’m not even sure if it’s able to do anything over what udevil+devmon already provides).

                I haven’t been able to get PCManFM to do anything useful for the current topic. In particular, i can’t seem to access a list of devices from it (there is an option that tries to access “computer:///” but that fails with error “Operation not supported”, actually, even the option to access the trash folder fails too). gvfs-backend was already installed, by the way (i even tried to install an extra package, gvfs-fuse, but that didn’t help either).

                SpaceFM fares better. It displays a list of devices, and is able to see the MTP device… if it has been mounted already, that is. SpaceFM is able to mount the device by itself, if you tell it to go to “mtp://”, but its automount capabilities aren’t working for me. It’s probably the best manual graphical solution so far (sorry gmtp, but i’d rather stick to a single file manager).

                That leaves us with the main issue of automounting. I bit the bullet and just wrote udev rules. It works? Mostly? I’ve managed to make it so that when the PC is fully operational (read: boot is finished, you’re logged in and ready to go open your web browser or whatever), you can plug in the device and it’ll mount it and pop a rox-filer window pointing into the mount directory, and if you end up disconnecting before unmounting, it’ll unmount the same directory for you. It’s pretty much the behavior i wanted, so i’m mostly satisfied.

                My only real issue is that it doesn’t integrate well with the system. Neither antiX-Mountbox nor unplugdrive.sh list the device, automount-antix configurations don’t apply to my device, right-clicking on the mounted directory on rox-filer and trying to unmount it there will throw an error (at least rox realizes it is a mount point!)[1]. I… think this is solvable? With the right udev rules maybe? I believe that you are supposed to be able to write a udev rule such that udevil would be able to recognize that the device is being plugged in, but this is beyond my current knowledge as a first-time user of udev.

                Again, thanks for the help. I hope we can find a proper solution here.

                [1] It’s worth mentioning that these are issues if you mount via SpaceFM, too, since all it does is call jmtpfs directly (which is what i’m currently doing with the udev rule).

                • This reply was modified 4 years, 3 months ago by hcp.
                #18486
                Forum Admin
                rokytnji
                  Helpful
                  Up
                  0
                  ::

                  1st off. My Galaxy phone won’t mount without permission given on the phone 1st.
                  2nd. GMTP package and following proper steps to open phone < including phone prompt permission > takes a bit of time.

                  Use the forum search function to find my gmtp posts.
                  Old forum search on Forum > Archive. L/H toolbar.
                  Edit : Like so
                  Or my sig link.

                  For troubleshooting

                  dmesg | tail

                  Helps me out at times.

                  Change the setting on the phone:

                  Settings -> Connected Devices -> USB

                  Select “Transfer files” from the USB menu and you’ll see the pixel’s files in the linux file manager. Afterwards, reset the phone’s USB setting to “Charge this device”.

                  from

                  https://www.linuxquestions.org/questions/linux-newbie-8/connecting-google-pixel-phone-to-ubuntu-computer-4175592209/

                  And repeated

                  https://linuxcommando.blogspot.com/2013/11/connect-android-and-linux-using-usb.html

                  • This reply was modified 4 years, 3 months ago by rokytnji.

                  Sometimes I drive a crooked road to get my mind straight.
                  Not all who Wander are Lost.
                  I'm not outa place. I'm from outer space.

                  Linux Registered User # 475019
                  How to Search for AntiX solutions to your problems

                Viewing 7 posts - 1 through 7 (of 7 total)
                • You must be logged in to reply to this topic.