Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mount Galaxy Nexus Android Phone via USB [solved]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
oneself
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2005
Posts: 107
Location: New York, NY

PostPosted: Sat Jun 16, 2012 10:38 pm    Post subject: Mount Galaxy Nexus Android Phone via USB [solved] Reply with quote

Hi,

I'm trying to mount my Galaxy Nexus phone by connecting a USB cable to my computer. When I connect the cable I see the following in the log:
Code:
Jun 16 18:32:38 lapself kernel: usb 2-2: new high-speed USB device number 5 using ehci_hcd
Jun 16 18:32:38 lapself kernel: usb 2-2: New USB device found, idVendor=04e8, idProduct=6860
Jun 16 18:32:38 lapself kernel: usb 2-2: New USB device strings: Mfr=2, Product=3, SerialNumber=4
Jun 16 18:32:38 lapself kernel: usb 2-2: Product: Galaxy
Jun 16 18:32:38 lapself kernel: usb 2-2: Manufacturer: samsung
Jun 16 18:32:38 lapself kernel: usb 2-2: SerialNumber: 0146970D0101F010


When I run lsusb, I can see the device:
Code:
Bus 002 Device 005: ID 04e8:6860 Samsung Electronics Co., Ltd


I followed the Gentoo USB Guide (http://www.gentoo.org/doc/en/usb-guide.xml), however, nothing gets automounted anywhere, and I'm not sure which device I need to mount. My laptop also has an SD card reader, and when I insert an SD card it works fine. Unfortunately, the Nexus Galaxy doesn't support an SD card, all of the memory is internal, and the only way to get to it is via USB cable.

Are there any other kernel modules I need to enable?

Thank you
_________________
There are 10 types of people, those who know binary and those who don't.


Last edited by oneself on Fri Jul 06, 2012 7:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sun Jun 17, 2012 1:36 am    Post subject: Reply with quote

A long shot - if you have CONFIG_USB_UAS=m in your config then try to blacklist it on the kernel line with modprobe.blacklist=uas

If it's set =y then try compiling the kernel with CONFIG_USB_UAS disabled

This has worked for another poster with usb storage errors https://forums.gentoo.org/viewtopic-t-925952-highlight-blacklist.html

Good luck :wink:
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
oneself
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2005
Posts: 107
Location: New York, NY

PostPosted: Sun Jun 17, 2012 1:45 am    Post subject: Reply with quote

No luck, it's already disabled:

Code:
$ grep CONFIG_USB_UAS .config
# CONFIG_USB_UAS is not set

_________________
There are 10 types of people, those who know binary and those who don't.
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Sun Jun 17, 2012 2:09 am    Post subject: Reply with quote

The only other help I can offer is my usb .config settings. I've mounted several dozen hard drives, four model cameras, sd cards and my garmin without any problems.

The list of enabled and disabled settings.

One more extra-long shot is to boot with the device plugged in. That has worked for others also, but I don't know why :?

Good luck :wink:
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sun Jun 17, 2012 5:15 am    Post subject: Reply with quote

The Nexus does not expose it's contents as a usb drive. You can access it only via MTP. Search google for "nexus mtp linux" and you will get lots of hits.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sun Jun 17, 2012 8:09 am    Post subject: Reply with quote

ppurka wrote:
The Nexus does not expose it's contents as a usb drive. You can access it only via MTP. Search google for "nexus mtp linux" and you will get lots of hits.


++

confirmed for me at least, had to go through the same fuss with mine. Doesn't allow for the usual mounting bits - annoying. Only mtp appears to work, and I have no interest in doing things that way
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
oneself
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2005
Posts: 107
Location: New York, NY

PostPosted: Sun Jun 17, 2012 6:02 pm    Post subject: Reply with quote

That's terrible. Well, I emerged gmtp, and I get a segfault when I try to connect:

Code:
Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1/S2.
Android device detected, assigning default bug flags
Error 1: Get Storage information failed.
Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles.
Error 2: (Look this up in ptp.h for an explanation.)
zsh: segmentation fault  gmtp

_________________
There are 10 types of people, those who know binary and those who don't.
Back to top
View user's profile Send private message
immudium
Guru
Guru


Joined: 12 Oct 2004
Posts: 332
Location: Utah

PostPosted: Thu Jun 21, 2012 4:29 am    Post subject: Reply with quote

I use
Code:
sys-fs/mtpfs

with the following line in /etc/fstab
Code:
mtpfs         /media/galaxy   fuse      user,noauto,allow_other   0 0

to mount my galaxy nexus. It's not an automount solution but it works and is the best solution I have for now. An alternative I suppose is to root the phone and then copy files over wifi via the sshdroid app but I haven't tried this.
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 528

PostPosted: Thu Jun 21, 2012 6:50 am    Post subject: Reply with quote

Take a look to jmtpfs (https://forums.gentoo.org/viewtopic.php?p=7066836#7066836) it worked for my galaxy S3
Back to top
View user's profile Send private message
DirtyHairy
l33t
l33t


Joined: 03 Jul 2006
Posts: 608
Location: Würzburg, Deutschland

PostPosted: Thu Jun 21, 2012 9:48 am    Post subject: Reply with quote

It seems that Android 3+ devices don't expose their storage as usb storage devices anymore and use MTP instead. While I think this is understandable as it is much more flexible and doesn't require the device to export complete block devices (which is fine for SD cards, but awkward for internal storage), I never have had much luck with MTP and linux. I have tried mtpfs and it works for me, but each file transfer is followed by a long pause, which makes transfers of lots of files (e.g. music) slow and awkward.

Luckily, I have found QuickSSHd for android which does NOT require root. I use it to access the device via sshfs, and it works without any complications. If I connect the device via USB and use USB tethering, I get very decent transfer speeds > 10MB/s. The program is available on the android market, but not for free; still, for me it has paid off.
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 528

PostPosted: Thu Jun 21, 2012 10:24 am    Post subject: Reply with quote

DirtyHairy wrote:
It seems that Android 3+ devices don't expose their storage as usb storage devices anymore and use MTP instead. While I think this is understandable as it is much more flexible and doesn't require the device to export complete block devices (which is fine for SD cards, but awkward for internal storage), I never have had much luck with MTP and linux. I have tried mtpfs and it works for me, but each file transfer is followed by a long pause, which makes transfers of lots of files (e.g. music) slow and awkward.

Luckily, I have found QuickSSHd for android which does NOT require root. I use it to access the device via sshfs, and it works without any complications. If I connect the device via USB and use USB tethering, I get very decent transfer speeds > 10MB/s. The program is available on the android market, but not for free; still, for me it has paid off.


Can you explain how do you connect with ssh via USB?

Thanks
Back to top
View user's profile Send private message
comprookie2000
Retired Dev
Retired Dev


Joined: 25 Jul 2004
Posts: 925
Location: Sun City Center, Florida

PostPosted: Thu Jun 21, 2012 10:45 am    Post subject: Reply with quote

I use AirDroid;
http://airdroid.com/
_________________
http://dev.gentoo.org/~dabbott/
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 528

PostPosted: Thu Jun 21, 2012 12:30 pm    Post subject: Reply with quote

Airdroid ok, so do I use it. But over wifi is a bit slow if you want to transfer a lot of stuff.
Back to top
View user's profile Send private message
DirtyHairy
l33t
l33t


Joined: 03 Jul 2006
Posts: 608
Location: Würzburg, Deutschland

PostPosted: Thu Jun 21, 2012 1:29 pm    Post subject: Reply with quote

@yellowhat: I activate USB tethering on the device. After establishing the connection via NetworkManager, the phone and computer are on the same network via usbnet. The device has a IP, Quicksshd shows it, I connect to it.
Back to top
View user's profile Send private message
oneself
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2005
Posts: 107
Location: New York, NY

PostPosted: Thu Jun 21, 2012 2:30 pm    Post subject: Reply with quote

@DirtyHairy: That sounds awesome! Can you post some more detailed instructions?
_________________
There are 10 types of people, those who know binary and those who don't.
Back to top
View user's profile Send private message
DirtyHairy
l33t
l33t


Joined: 03 Jul 2006
Posts: 608
Location: Würzburg, Deutschland

PostPosted: Fri Jun 22, 2012 7:25 am    Post subject: Reply with quote

1) Activate USB tethering on your phone while it's connected to USB --- it's under Settings -> Networks -> Tethering (translating from german here, so I am not sure about the english labels). A usbnet device will now appear on your computer (provided you activated CONFIG_USB_USBNET and CONFIG_USB_NET_RNDIS_HOST in your kernel), you should be able to see it in ifconfig -a.

2) The device provides a dhcp server on the connection, so activate dhcp on it. You can either do it manually using dhcpcd or dhclient, or, more conveniently, if you use networkmanager in your desktop environment, an entry for the connection will appear which you can activate by clicking on it.

3) In tethering mode, the android device acts as a router and provides masquerading, so you can now access the internet using your phone's connection. As a side effect, your computer now is on a network with your device, which has an IP. The network connection is encapsulated over USB, and you can ping and ssh your phone.

4) Fire up Quicksshd. It will show a list of network interfaces and the corresponding IPs, take the one from usbnet0, rndis0 (or such, depends on your device). Start the server, connect to it, voila :) Be aware that Quicksshd can only run on ports >1024 without root priviledges, so you'll have to adjust your ssh and sshfs commands on your side to the correct port (2222 by default).

This sounds more complicated as it really is. It boils down to: activate tethering -> activate connection (NM should even do it automatically) -> start quicksshd -> connect. If you want to mount your device into the filesystem, you can use sshfs (in portage).

The only downside is that you will be using tethering while you are connected to your device, so take care with internet access. However, if you activate wifi on your device, you will tethering the wifi instead of your mobile connection, which is harmless to your data plan. If your computer is connected via ethernet, network manager will give it precedence over the tethered connection, so that's also fine. You can also work around this point by manually configuring routes, but that's propably more hassle than it's worth as it spoils the simplicity of the solution ;) Also, take care to set a strong password in Quicksshd, depending on how your phone is connected to the net and your data plan provider's setup, the ssh server will be exposed over wifi and possibly even to the internet.
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 528

PostPosted: Fri Jun 22, 2012 11:00 am    Post subject: Reply with quote

Thanks that worked for me
Back to top
View user's profile Send private message
oneself
Tux's lil' helper
Tux's lil' helper


Joined: 02 Jul 2005
Posts: 107
Location: New York, NY

PostPosted: Fri Jun 22, 2012 3:22 pm    Post subject: Mount Galaxy Nexus Android Phone via USB [solved] Reply with quote

Unfortunately, I am using the Verizon Galaxy Nexus, which wants more money to tether via USB (or Wifi).

Another option I managed to find is to use adb to transfer files. To do this, download the latest Android SDK and follow the instructions (http://developer.android.com/sdk/index.html).

Once this is installed and adb is in your path, you should be able to access your device via:
Code:
adb shell

This is a nice way to figure out the path you want to transfer to or create any directories. Once you're done exploring, exit the shell, and use the push command to transfer files:
Code:
adb push  /path/to/local/file /sdcard/path/to/file

You can only do one file at a time, but it's easy to write a little shell for loop to move multiple files.
_________________
There are 10 types of people, those who know binary and those who don't.
Back to top
View user's profile Send private message
tonyp
n00b
n00b


Joined: 27 Apr 2005
Posts: 9

PostPosted: Sat Jun 23, 2012 5:20 pm    Post subject: Reply with quote

immudium wrote:
I use
Code:
sys-fs/mtpfs

with the following line in /etc/fstab
Code:
mtpfs         /media/galaxy   fuse      user,noauto,allow_other   0 0

to mount my galaxy nexus. It's not an automount solution but it works and is the best solution I have for now. An alternative I suppose is to root the phone and then copy files over wifi via the sshdroid app but I haven't tried this.


If you change the noauto option will it auto mount?

I just use the command line options

Code:
mtpfs /media/android_mtp
fusermount -u /media/android_mtp
Back to top
View user's profile Send private message
*zensiert*
n00b
n00b


Joined: 10 Oct 2004
Posts: 55
Location: Germany

PostPosted: Tue Jun 26, 2012 11:13 am    Post subject: Re: Mount Galaxy Nexus Android Phone via USB [solved] Reply with quote

oneself wrote:
Unfortunately, I am using the Verizon Galaxy Nexus, which wants more money to tether via USB (or Wifi).

Another option I managed to find is to use adb to transfer files. To do this, download the latest Android SDK and follow the instructions (http://developer.android.com/sdk/index.html).

Once this is installed and adb is in your path, you should be able to access your device via:
Code:
adb shell

This is a nice way to figure out the path you want to transfer to or create any directories. Once you're done exploring, exit the shell, and use the push command to transfer files:
Code:
adb push  /path/to/local/file /sdcard/path/to/file

You can only do one file at a time, but it's easy to write a little shell for loop to move multiple files.


Well actually adb push supports pushing whole directories.

Unfortunately, if I use adb push to transfer music to my Galaxy Nexus, "Play Music" does not find them. However, I see the files on the phone when using ls in /sdcard/Music. If I connect via MTP, I don't see the files in the Music folder.
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Wed Jul 18, 2012 4:57 pm    Post subject: Reply with quote

Very strange scenario here - my Galaxy Nexus automounts just fine (!), but my new Nexus 7 does not. The system does see it:
Code:
Bus 002 Device 007: ID 0b05:179c ASUSTek Computer, Inc.

Weird that the one works fine and the other does not, as they are both presumably MTP.
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
salman malik
n00b
n00b


Joined: 14 Jul 2012
Posts: 4

PostPosted: Wed Jul 18, 2012 5:30 pm    Post subject: Reply with quote

my usb become right protected,
is there any way that i can delete the data in my usb if any one can know then tell me the process to delete the data.
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Wed Jul 18, 2012 7:20 pm    Post subject: Mtp Reply with quote

In regards to MTP, if your device is fairly new install media-libs/libmtp-9999 (you may need to unmask and/or keyword it) - both media-sound/gmtp and sys-fs/mtpfs rely on this library.

For the Nexus 7 I just posted a diff against the current git on sourceforge:
Code:
--- src/music-players.h.orig   2012-07-18 14:52:26.132912175 -0400
+++ src/music-players.h   2012-07-18 15:01:54.359110664 -0400
@@ -1554,6 +1554,12 @@
   { "Google Inc (for Asus)", 0x18d1, "TF101 Transformer", 0x4e0f,
       DEVICE_FLAGS_ANDROID_BUGS },
   // Reported by Laurent Artaud <laurenta@users.sourceforge.net>
+  { "Google Inc (for Asus)", 0x18d1, "Nexus 7", 0x4e41,
+      DEVICE_FLAGS_ANDROID_BUGS },
+  // Reported by Chris Smith <chris@realcomputerguy.com>
+  { "Google Inc (for Asus)", 0x18d1, "Nexus 7 (USB debug mode)", 0x4e42,
+      DEVICE_FLAGS_ANDROID_BUGS },
+  // Reported by Chris Smith <chris@realcomputerguy.com>
   { "Google Inc (for Samsung)", 0x18d1, "Nexus S", 0x4e21,
       DEVICE_FLAGS_ANDROID_BUGS },
   // WiFi-only version of Xoom


NOTE: git has been updated and now works with the Nexus 7 !!
No longer a need to patch just (re)install media-libs/libmtp-9999.

Chris
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Thu Jul 19, 2012 5:18 am    Post subject: Re: Mount Galaxy Nexus Android Phone via USB [solved] Reply with quote

oneself wrote:
Unfortunately, I am using the Verizon Galaxy Nexus, which wants more money to tether via USB (or Wifi).


immensely curious - how are they enforcing this? If you try to enable it, does it prompt you, or is it just altogether greyed out?

That, to me, would be infuriating - having to pay money to enable a feature the OS/phone supports by default. Ergo, why I've bought the entire family the unlocked GSM Galaxy Nexus, and while we're stuck with TMO's garbage network, our phones are ours to use and abuse as we see fit.
_________________
Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash
Back to top
View user's profile Send private message
kfirufk
n00b
n00b


Joined: 11 Jun 2012
Posts: 2
Location: Israel

PostPosted: Wed Aug 15, 2012 10:53 am    Post subject: mtpfs works with my galaxy note :) Reply with quote

thanks! i add the mtpfs mount line to /etc/fstab
mount finally works! thnks a lot :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum