==== Google Nexus 5 und 7 unter Ubuntu 12.04 LTS ins Dateisystem mounten ====
=== Ermitteln der sog. ''Device-'' oder ''Prooduct-'' und der ''Vendor-ID'' des verwendeten Gerätes ===
Beim Nexus 5 (USB Debugging Modus ausgeschaltet!) ...
mtp-detect
...
Google Inc (for LG Electronics/Samsung): Nexus 4/10 (MTP) (18d1:4ee1)
Hier lautet die sog. ''Vendor-ID'' **18d1** und die sog. ''Product-ID'' ist **4ee1**
\\
und mit eingeschaltetem Debug Modus:
mtp-detect
...
Google Inc (for LG Electronics/Samsung): Nexus 4/10 (MTP) (18d1:4ee2)
Hier lautet die sog. ''Vendor-ID'' **18d1** und die sog. ''Product-ID'' ist **4ee2**
=== Einhängepunkte erstellen ===
mkdir -p /media/Nexus_5 && chown -R root:root /media/Nexus_5 && chmod 777 /media/Nexus_5
mkdir -p /media/Nexus_7 && chown -R root:root /media/Nexus_7 && chmod 777 /media/Nexus_7
=== UDEV Regeln erstellen ===
cat < /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee1", MODE="0666", OWNER="christoph"
# Nexus_5 - MTP mount & unmount rules
ENV{ID_MODEL}=="Nexus_5", ENV{ID_MODEL_ID}=="4ee1", ACTION=="add", RUN+="/usr/bin/sudo -b -u christoph /usr/bin/go-mtpfs -dev=18d1:4ee1 -allow-other=true /media/Nexus_5"
ENV{ID_MODEL}=="Nexus_5", ENV{ID_MODEL_ID}=="4ee1", ACTION=="remove", RUN+="/bin/umount /media/Nexus_5"
# Nexus_7 - MTP mount & unmount rules
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4ee1", ACTION=="add", RUN+="/usr/bin/sudo -b -u christoph /usr/bin/go-mtpfs -dev=18d1:4ee1 -allow-other=true /media/Nexus_7"
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4ee1", ACTION=="remove", RUN+="/bin/umount /media/Nexus_7"
##
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0666", OWNER="christoph"
# Nexus 5 without debug mode enabled - MTP mount & unmount rules
ENV{ID_MODEL}=="Nexus_5", ENV{ID_MODEL_ID}=="4ee2", ACTION=="add", RUN+="/usr/bin/sudo -b -u christoph /usr/bin/go-mtpfs -dev=18d1:4ee2 -allow-other=true /media/Nexus_5"
ENV{ID_MODEL}=="Nexus_5", ENV{ID_MODEL_ID}=="4ee2", ACTION=="remove", RUN+="/bin/umount /media/Nexus_5"
# Nexus 7 without debug mode enabled - MTP mount & unmount rules
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4ee2", ACTION=="add", RUN+="/usr/bin/sudo -b -u christoph /usr/bin/go-mtpfs -dev=18d1:4ee2 -allow-other=true /media/Nexus_7"
ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4ee2", ACTION=="remove", RUN+="/bin/umount /media/Nexus_7"
EOT
Neue UDEV Reglen laden ohne den Rechner neu zu starten:
udevadm control --reload-rules
=== FUSE Regel hinzufügen ===
cat <> /etc/fuse.conf
# 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
EOT
=== Einträge in der fstab-Datei erzeugen ===
cat <> /etc/fstab
#
# declaration of Nexus 5 to be mounted under /media/Nexus_5
DeviceFs(Nexus\0405) /media/Nexus_5 fuse.DeviceFs(Nexus\0405) allow_other,rw,user,noauto 0 0
# declaration of Nexus 7 to be mounted under /media/Nexus_5
DeviceFs(Nexus\0407) /media/Nexus_7 fuse.DeviceFs(Nexus\0407) allow_other,rw,user,noauto 0 0
EOT