Does anyone know how to mount a Droid 2 Global

Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#1
Does anyone know how to mount a droid 2 global. Mine paritally shows up like a CD, but it doesn't allow access to the storage. Under windows, the device shows up with two different drive letters.

Thanks.

D.o.
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#2
Maybe this would help:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.webupd8.org/2012/12/how-to-mount-android-40-ubuntu-go-mtpfs.html"
linktext was:"How To Properly Mount Android 4.0+ Devices In Ubuntu Using Go-mtpfs"
====================================
.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#3
Hmmm... I'll check it out. Mine is only 2.3 and still supports usb storage mode, supposedly. Personally I think Motorola screwed the pooch and made something that should be simple hard.
Posts: 765
rust collector
Joined: 27 Dec 2011
#4
The wife has a android 2.3 phone, but it is a htc, and it mounts just fine as usb storage, so it does work with 2.3.
Posts: 630
Eino
Joined: 12 Oct 2012
#5
I know that the"GO" programming language works in antiX, but I have not seen a full app yet.

Here is the git repository for mounting Android devices as a MTP device.


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://github.com/hanwen/go-mtpfs"
linktext was:"http://github.com/hanwen/go-mtpfs"
====================================
Posts: 1,062
Dave
Joined: 20 Jan 2010
#6
rust collector wrote:The wife has a android 2.3 phone, but it is a htc, and it mounts just fine as usb storage, so it does work with 2.3.
+2 for android 2.3 on 2 htc models of phones
+1 for android 4.0 on 1 htc phone
+1 for android 4.1 on a tablet (i cannot remember the manufacturer)
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#7
I did manage to mount the droid 2 global, but I'm not sure why this works.

I monitored /dev during this process.

Before inserting the usb connector cable, the device obviously doesn't show up.
After inserting the usb connector cable, two new devices show in /dev. sr1 (as a cdrom) and sdb (no numerals). sr1 is mountable readily as a cdrom. sdb is not mountable and in fact mountbox and gparted do not list its presence.

Just fooling around, I ran cat /dev/sdb - this generated some goobly-gook ascii characters in the terminal...but after that /dev/sdb1 shows up. which is mountable easily (vfat).

any thoughts on how to go about mounting sdb1 without having to run cat everytime I plug the phone in?

Thanks.

D.O. (who now wishes he had an HTC __{{emoticon}}__ )
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#8
So far I have two methods by witch antiX will recognize the mountable usb parition on the droid 2. I can either run

Code: Select all

$cat /dev/sdb


manually and then manually quit the command with cntrl-c

or as root

Code: Select all

# fdisk -l 
which will poll all disks/devices for partitions. The benefit here is that the command does not require intervention to stop running. the downside is that you have to run it as root. I'm not sure I want to open up fdisk to a password-less sudo, but I would like to utilize a script to mount the droid 2. Any thoughts?

Thanks.

D.O.
Posts: 1,308
BitJam
Joined: 31 Aug 2009

17 Apr 2013, 17:18 #9

I think the best thing to do is to write a udev rule and put it in /etc/udev/rules.d/. I'm no expert but I would try something like:

Code: Select all

ACTION=="add",ATTRS{model}=="XXXX",KERNEL=="sd?",BUS="usb" RUN+="/usr/local/bin/droid-fdisk"
You can find what to replace XXXX with by running:

Code: Select all

$ udevadm info -a -p $(udevadm info -q path -n /dev/sdb)
Then write the /usr/local/bin/droid-fdisk script:

Code: Select all

#!/bin/bash
/sbin/fdisk -l $DEVNAME >> /var/log/droid-fdisk.log 2>&1
Finally make sure you do:

Code: Select all

# chmod a+x /usr/local/bin/droid-fdisk
You don't need to use ATTRS{model}. There should be copious output from the udevadm command and there might be other/better way to identify your device.

Yes, this process is needlessly cumbersome and obfuscated.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#10
I'm definitely no expert, but using udev to call the fdisk command looks like a good idea as it will get around the"being root" problem.

Thanks!
anticapitalista
Posts: 5,959
Site Admin
Joined: 11 Sep 2007
#11
Does spacefm see the device?

You could also try adding

spacefm -d &

to the ~/.xinitrc-custom file. You will need to logout and in afterwards.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#12
No, spacefm doesn't see it either. Nothing in the system (and indeed the system itself) sees the mountable partition (usually sdb1) until something is run that polls the partition tables (fdisk) or just tries to read whatever data is at /dev/sdb. Once /dev/sdb1 shows up, then its is automounted by udev and perfectly fine as far as I can tell. I think motorola put some sort of intermediate layer between the android filesystem and the host system. In windows, you get this cdrom partition that mounts first and tries to auto-install a driver. Under antiX, I do get the cd partition automounted at /media/sr1, but its just a cd image with no access to the usb-storage on the phone. The coding must not be a real security thing though, because polling the partitions with fdisk -l or using cat /dev/sdb will force the host system to see the mountable usb storage partition, and then all is well. I've seen some people in the droid 2 motorola forums complaining about this, but the issues usually have to do with mtp access instead of usb-storage mode. Most of them gave up.

Just one more weird thing in my closet of weird things, I guess.
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#13
I've got a usb drive that has /dev/sr1 on it. It's a
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://en.wikipedia.org/wiki/U3"
linktext was:"SanDisk U3 Cruzer"
====================================
:
U3 was a joint venture between SanDisk and M-Systems, producing a proprietary method of launching Windows applications from special USB flash drives.


In other news, maybe the best program to read from /dev/sdb is"dd":

Code: Select all

dd if=$DEVNAME of=/dev/null bs=XXX count=YYY
The total number of bytes read will by XXX times YYY.
Posts: 2,238
dolphin_oracle
Joined: 16 Dec 2007
#14
hah, that was a interesting use of dd, and it worked perfectly.

Code: Select all

$dd if=/dev/sdb of=/dev/null bs=1024 count=1


read 1 record and quit and got sdb1 to show up. Thanks!

that helper app thing kind of makes sense. I noticed on the work pc (windows) that there is a motorola helper app that asks to launch an application everytime I plug the phone in. I rarely plug the phone in to that computer so I never noticed. I apparently never installed the helper app on the windows computer at home.