You are not logged in.

#1 2010-09-07 13:05:29

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

Cannot mount Android/HTC Hero.

When I plug my htc hero (2.2) into my laptop (arch x86_64), and ofc select 'mount sd' on the phone itself, the system fail to see partitions on said storage.

To mount the sd card (which lets say is on sdb1. only 1 partition), I need to either

fdisk -l /dev/sdb

or

mount /dev/sdb /mnt

The first mount command fails of course, but it makes /dev/sdb1 visible to the system. Some googling suggests this is because linux is waiting for the device to settle, but in classic htc design the device does not/fails to notify the system that it has.

Is there a fix for this? Maybe I could set my system to not bother waiting for Android? Or just some how torture the device ;D

Edit: I was wrong, it seems only android is causing this problem (htc hero). Previously I suspecteed all usb disks due to my autofs approach, which i boched myself.

Last edited by GalacticArachnid (2010-09-07 18:55:02)

Offline

#2 2010-09-08 10:28:16

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Cannot mount Android/HTC Hero.

So you got it fixed? I've never experienced that before. I have an HTC Hero too but I have a Froyo rom on it now. The stock rom is a piece of ****.


neutral

Offline

#3 2010-09-08 13:56:42

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Cannot mount Android/HTC Hero.

I get the same behaviour from my HTC Desire. I'm tempted to just wrap the mount command in a function that makes the two calls an leave it at that, but I suspect there may be a udev solution. I just haven't yet sorted out my udev side of things and still manually mount everything.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#4 2010-09-08 17:25:43

surfed
Member
From: Vienna Austria
Registered: 2009-10-30
Posts: 86

Re: Cannot mount Android/HTC Hero.

I wonder if this only is an issue with stock HTC rom. I am running Villain ROM on my Hero and have no issues.....

Offline

#5 2010-09-08 18:19:42

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Cannot mount Android/HTC Hero.

i have this issue with my Eris, i'm running a rooted version of 2.1.  dunno if the problem started b/c it's rooted or b/c it's 2.1 -- it worked fine with stock 1.5.

i currently just use the sdk to move files back and forth -- kind of annoying.

Offline

#6 2010-09-08 18:22:17

surfed
Member
From: Vienna Austria
Registered: 2009-10-30
Posts: 86

Re: Cannot mount Android/HTC Hero.

Coming to think of it, i resolved this once by wiping my phone...not elegant but it worked.

Offline

#7 2010-09-08 20:08:11

surfed
Member
From: Vienna Austria
Registered: 2009-10-30
Posts: 86

Re: Cannot mount Android/HTC Hero.

Maybe you clicked "Dont ask again" with charge only option?

Offline

#8 2010-09-08 20:30:41

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Cannot mount Android/HTC Hero.

Actually, just noticed that I use two different commands:

sudo mount /dev/sdb /mnt/usbdisk
sudo mount /dev/sdb1 /mnt/usbdisk

does the trick.

It's not the "Don't ask again" option here, as I've never set that.
Running Froyo (2.2).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#9 2010-09-09 22:13:13

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Cannot mount Android/HTC Hero.

@skanky, that's not really a solution but just a known workaround -- reread the first post and you'll see he mentions it: "The first mount command fails of course, but it makes /dev/sdb1 visible to the system."

I'd love to find a legit fix...

Offline

#10 2010-09-10 00:00:07

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: Cannot mount Android/HTC Hero.

As far as udev goes, I just plug my phone in, select enable USB on the phone and it auto-mounts with nautilus. I did nothing to customise this behaviour. I am not using the stock rom. I really can't remember whether or not I had trouble with the stock rom it was so long ago now.
Seriously, do yourself a favour and get rooted. http://forum.xda-developers.com/showthread.php?t=774246


neutral

Offline

#11 2010-09-10 09:29:43

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Cannot mount Android/HTC Hero.

brisbin33 wrote:

@skanky, that's not really a solution but just a known workaround -- reread the first post and you'll see he mentions it: "The first mount command fails of course, but it makes /dev/sdb1 visible to the system."

I'd love to find a legit fix...

Yes, I had said that that's what I do (see my earlier post), but then realised that my first command is different - his is better as a workaround, but I thought the different command may give a hint towards a solution.

All information is good at this stage. wink

As an extra bit, I noticed that when I run the first command and it fails, udev then picks up on the card being settled and immediately mounts it. It doesn't mount it before that.

Tow other bits of information. This is a long-standing issue. I've seen references to it from at least a year ago in a G1 or Nexus (forget which).
There is/was a similar issue whereby setting USB Debug on fixed it, but that doesn't work for me. It might be worth a try for others, though.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#12 2010-09-10 11:28:26

cookiecaper
Member
Registered: 2007-09-22
Posts: 198

Re: Cannot mount Android/HTC Hero.

Using a Dream/G1 with custom ROM (cyanogenmod 6 at the moment, previously openeclair and completeeclair) and have no such issues here. I also did nothing to customize the behavior. If you are running without hal, perhaps you can try turning it on. You might also try watching the output of adb logcat when you turn on USB mode and see if there is anything unusual.

Offline

#13 2010-09-11 14:55:26

GalacticArachnid
Member
Registered: 2009-01-02
Posts: 155
Website

Re: Cannot mount Android/HTC Hero.

The stock firmware is crap for sure. I run Froyo myself xD

This problem seems more htc related than android. As I recall, the same thing was a problem when I run stock 1.5, rooted 1.5 as well as rooted 2.1 then 2.2.

I think a fix for now will be a seperate udev hook to double mount android phones and a seperate one to handle all other usb storage mediums. Hardly elegant but will probably work.

I shall try this in a bit and post an update to how it works, as well as some code wink

Offline

#14 2010-09-19 21:41:35

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Cannot mount Android/HTC Hero.

Last I looked I couldn't find a stable, up to date, rom for a Desire to root. I've got the HTC Froyo one in and apart from this issue, not sure what advantages I'd get from rooting anyway. So I thought trying to solve this with udev might be useful - for learning udev as well.

Anyway, the following command also triggers a successful udev event completion (and mounting using the udev sd card rules - eg from the wiki):

sudo udevadm trigger --attr-match=model=Android* --action=change

I have tried to put that into a udev rule to run first only when the Android* gets added, but it doesn't trigger when I use ACTION="add" and it causes a loop when that's not there (though it does mount). I'm going to try and see if I can set some traps to stop the loops, but hasn't worked so far.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#15 2010-12-30 18:14:06

chaitan3
Member
Registered: 2010-12-30
Posts: 4

Re: Cannot mount Android/HTC Hero.

Finally got a working udev rule for executing partprobe when the android phone is inserted. The following rule works on my HTC Desire HD

KERNEL=="sd?", ATTRS{model}=="Android*", ACTION=="add", RUN+="/bin/bash -c '/bin/sleep 2 && /usr/sbin/partprobe'"

The reason why the rule doesn't execute with RUN+="/usr/sbin/partprobe" is that some time is required for the device node to appear, hence a delay is required. You may need to adjust the sleep value for the device to settle down.

Offline

Board footer

Powered by FluxBB