Working MTP on Ubuntu for Galaxy Nexus, Nexus 7 and Acer A500
Where to start.
I found some instructions for the Nexus 7 (which I had just brought) on this site Ubuntu 12.04 - Automount Nexus 7 in MTP mode. All credit to the author of that page for figuring it out.
The instructions i have below come from this site, are trimmed to the commands, if you want more explanation see the above site.
I used Ubuntu 12.10, and have configured for my Nexus 7, Galaxy Nexus and Acer A500.
Instructions
Configure FUSE
Change /etc/fuse.conf so its read by all..
# sudo chmod a+r /etc/fuse.conf
Edit /etc/fuse.conf to remove the comment # from user_allow_other so the default fuse.conf will look like
# Set the maximum number of FUSE mounts allowed to non-root users.
# The default is 1000.
#
#mount_max = 1000
# Allow non-root users to specify the 'allow_other' or 'allow_root'
# mount options.
#
user_allow_other
Compile and install go_mtp
# sudo apt-get install libmtp-dev golang
# mkdir /tmp/go
# export GOPATH=/tmp/go
# go get github.com/hanwen/go-mtpfs
# sudo mv /tmp/go/bin/go-mtpfs /usr/local/sbin/go-mtpfs
# sudo chmod a+x /usr/local/sbin/go-mtpfs
Create Mount Point(s)
Use the following as you need..
# sudo mkdir /media/Nexus7
# sudo chmod 777 /media/Nexus7
# sudo mkdir /media/GalaxyNexus
# sudo chmod 777 /media/GalaxyNexus
# sudo mkdir /media/A500
# sudo chmod 777 /media/A500
Setup udev rules
Use your favourite editor and create the following file (remove any other android udev rules you might have experimented with first).
# sudo vi /etc/udev/rules.d/99-android.rules
Paste in the following contents. you can remove rules you don't need, The two nexus devices appear to have the same ids for the bootloader and recovery.
NOTE: you need to replace #YOURLOGIN# with your username/login.
# Google Nexus 7 & Galaxy Nexus 16 Gb Bootloader & recovery mode
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0666" # Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d001", MODE="0666" # Recovery
# Google Nexus 7 16 Gb PTP mode (camera)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e43", MODE="0666" # PTP media
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e44", MODE="0666" # PTP media with USB debug on
# Google Nexus 7 16 Gb MTP mode (multimedia device)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e41", MODE="0666" # MTP media
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0666" # MTP media with USB debug on
# Google Nexus 7 MTP mode : automatic mount when plugged
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e41", ACTION=="add", RUN+="/usr/bin/sudo -u #YOURLOGIN# /usr/local/sbin/go-mtpfs -allow-other=true /media/Nexus7"
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e42", ACTION=="add", RUN+="/usr/bin/sudo -u #YOURLOGIN# /usr/local/sbin/go-mtpfs -allow-other=true /media/Nexus7"
# Google Nexus 7 MTP mode : automatic unmount when unplugged
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e41", ACTION=="remove", RUN+="/bin/umount /media/Nexus7"
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e42", ACTION=="remove", RUN+="/bin/umount /media/Nexus7"
# Google Galaxy Nexus 16 Gb Bootloader & recovery mode
#SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0666" # Bootloader
#SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d001", MODE="0666" # Recovery
# Google Galaxy Nexus 16 Gb PTP mode (camera)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6865", MODE="0666" # PTP media
#SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="4e44", MODE="0666" # PTP media with USB debug on
# Google Galaxy Nexus 16 Gb MTP mode (multimedia device)
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="685c", MODE="0666" # MTP media
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", MODE="0666" # MTP media with USB debug on
# Google Nexus 7 MTP mode : automatic mount when plugged
ENV{ID_MODEL}=="Galaxy_Nexus", ENV{ID_MODEL_ID}=="685c", ACTION=="add", RUN+="/usr/bin/sudo -u #YOURLOGIN# /usr/local/sbin/go-mtpfs -allow-other=true /media/GalaxyNexus"
ENV{ID_MODEL}=="Galaxy_Nexus", ENV{ID_MODEL_ID}=="6860", ACTION=="add", RUN+="/usr/bin/sudo -u #YOURLOGIN# /usr/local/sbin/go-mtpfs -allow-other=true /media/GalaxyNexus"
# Google Nexus 7 MTP mode : automatic unmount when unplugged
ENV{ID_MODEL}=="Galaxy_Nexus", ENV{ID_MODEL_ID}=="685c", ACTION=="remove", RUN+="/bin/umount /media/GalaxyNexus"
ENV{ID_MODEL}=="Galaxy_Nexus", ENV{ID_MODEL_ID}=="6860", ACTION=="remove", RUN+="/bin/umount /media/GalaxyNexus"
# Acer A500 16 Gb Bootloader & recovery mode
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", ATTR{idProduct}=="3201", MODE="0666" # Bootloader
#SUBSYSTEM=="usb", ATTR{idVendor}=="0502", ATTR{idProduct}=="d001", MODE="0666" # Recovery
# Acer A500 16 Gb PTP mode (camera)
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", ATTR{idProduct}=="33b2", MODE="0666" # PTP media
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", ATTR{idProduct}=="33b1", MODE="0666" # PTP media with USB debug on
# Acer A500 16 Gb MTP mode (multimedia device)
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", ATTR{idProduct}=="3341", MODE="0666" # MTP media
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", ATTR{idProduct}=="3325", MODE="0666" # MTP media with USB debug on
# Acer A500 MTP mode : automatic mount when plugged
ENV{ID_MODEL}=="Acer_Iconia_Tab_A500", ENV{ID_MODEL_ID}=="3341", ACTION=="add", RUN+="/usr/bin/sudo -u #YOURLOGIN# /usr/local/sbin/go-mtpfs -allow-other=true /media/A500"
ENV{ID_MODEL}=="Acer_Iconia_Tab_A500", ENV{ID_MODEL_ID}=="3325", ACTION=="add", RUN+="/usr/bin/sudo -u #YOURLOGIN# /usr/local/sbin/go-mtpfs -allow-other=true /media/A500"
# Acer A500 MTP mode : automatic unmount when unplugged
ENV{ID_MODEL}=="Acer_Iconia_Tab_A500", ENV{ID_MODEL_ID}=="3341", ACTION=="remove", RUN+="/bin/umount /media/Nexus7"
ENV{ID_MODEL}=="Acer_Iconia_Tab_A500", ENV{ID_MODEL_ID}=="3325", ACTION=="remove", RUN+="/bin/umount /media/A500"
NOTE: if you used gedit and you have edited the file, you need to remove 99-android.rules~ as udev will get upset..
Next, restart udev
# sudo service udev restart
Edit /etc/fstab
Add the following to /etc/fstab
DeviceFs(Nexus\0407) /media/Nexus7 fuse.DeviceFs(Nexus\0407) allow_other,rw,user,noauto 0 0
DeviceFs(Galaxy\040Nexu) /media/GalaxyNexus fuse.DeviceFs(Galaxy\040Nexu) allow_other,rw,user,noauto 0 0
DeviceFs(A500) /media/A500 fuse.DeviceFs(A500) allow_other,rw,user,noauto 0 0
Finished.
You can now connect your devices and the internal storage will be available for use, you should remember to un-mount before disconnecting though it doesn't seem to do any harm..
Note: it seems that the ENV{ID_MODEL} for the nexus 7 changed to Nexus_7 at some point (I think with the android 4.2 update)..
From http://www.winters.org.nz/android-hints-tips-stuff/working-mtp-on-ubuntu