[Solved] Can't mount an Android phone as a mass-storage dev

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Neophox

[Solved] Can't mount an Android phone as a mass-storage dev

Post by Neophox »

Solved: Reformatted the SD card, using fat32, 32 kb allocation. Thanks, guys.

I'm trying to mount an HTC Desire HD as a mass storage device. So far, I've set the phone to default to mounting as a USB device, enabled debug, tried a different cord, tried both the front and back usb ports, tried the same cord on a windows machine (it worked). I've also added a rule to udev, with no luck. The computer sees that an android device is plugged in, but I can't access it. Watching it from Computer when it first connects, it will recognize it's an android phone, mount the file system (I believe. It will briefly display the size of the sdcard), then fail, and go back to saying HTC Android Phone. At the same time, the phone will prompt for a connection type. I can specify mass media storage, at which point it will try to mount, then revert to charging only. Pulling down the menu only gives me the options to charge, sync, tether, or share internet.
I've tried sudo mount -t vfat -U (uuid) /media/droid, which fails to find a partition. lsusb returns a single device, ID 0bb4:0ca2 High Tech Computer Corp, located on a usb 2.0 hub. I think this may be part of my problem, as it seems like other forum posts mention two devices being mounted when the phone is plugged in. I'm out of ideas, and would appreciate any advice. I've seen a post suggesting it may be possible to install the android developer platform, and run the adp server with super-user privileges, and that may solve the issue. Anyone try this? If so, could you give simple advice? I'm pretty new to linux. I've cross-posted on an android support site, as well, so we'll see where that takes me.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Can't mount an Android phone as a mass-storage device

Post by remoulder »

Neophox wrote: added a rule to udev
You don't need to add any rules, install any drivers adb or otherwise, enable debug or issue any mount commands, you just need to set the phone as mass storage device on connection. If this is not working try booting from a live cd/dvd and plugging the phone there. If it works then it is something in your installation/settings, or perhaps something on your sdcard.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
JHutson456

Re: Can't mount an Android phone as a mass-storage device

Post by JHutson456 »

Try this

http://forum.xda-developers.com/showthread.php?t=921169

When you're done with instal, reboot your computer and phone.

Sent from my HTC Glacier using Tapatalk
Neophox

Re: Can't mount an Android phone as a mass-storage device

Post by Neophox »

So, I've tried mounting the phone as a mass storage device when running off of a Mint 11 live-cd, with no luck. I'm downloading 10 and 12RC, and will probably test the two of them, along with ubuntu, on the weekend. Following the guide to install adb gave me a bit of information. If I don't mount the sdcard, I'm able to access it through adb. This makes sense, because it's mounted on the phone, and adb just acts as an interface between the two. When I try and mount the SD card, though, I lose access both from the phone, and the computer. Again, this makes sense to me, as it has to be unmounted from the phone to be mounted by the computer. It looks like Mint is fumbling the handoff, and the sdcard just sits in limbo, with neither system aware of it's existence. I'm not sure if I mentioned it in the initial post, but I'm pretty sure that mint tries to mount the sd card and fails, because I can watch the icon from Computer, and it will briefly flash the card's size in the label, before reverting to HTC Android Phone. I pulled the sdcard and was able to mount it with a USB reader, so it doesn't seem to be a problem with the card. I really don't know where to look, now. I guess adb gives me a basic interface, allowing me to push and pull objects, but it's still a far cry from actually mounting the card and being able to browse the file system graphically.
User avatar
900i
Level 6
Level 6
Posts: 1142
Joined: Sat Nov 18, 2006 9:30 am
Location: Wakefield, UK

Re: Can't mount an Android phone as a mass-storage device

Post by 900i »

Had same problem with a Wildfire running sense. Never got to the bottom of it as it was'nt my phone. All my phones run cyanogen roms which is vanilla android and I have never had a problem with mint or windows.
Desktop Core i7 Linux Mint 21.1 / Laptop Dell Precision M6400 Linux Mint 21.1
Neophox

Re: Can't mount an Android phone as a mass-storage device

Post by Neophox »

Well, I've tested my phone with ubuntu 11.10, LMDE 2011/09, and Mint 9, all with no success. I also monkeyed around a bit in the bios, to see if I could find anything relevant in there. Not much to say about it. Just for giggles, I tested it on windows 7 again, on the same machine, and it definitely still works. One thing I noticed when I got back on mint was that the phone properties listed from Computer say that the phone is of type unknown type (application/octet-stream), implying mint really has no idea what to do with it. I really don't know where the problem could be coming from. I don't think it's the phone or the SD card, because they're mountable in windows with no problems. As well, that kind of rules out any hardware issues within my computer. It really looks like there's something wrong in a driver, or something. Can anyone recommend another OS built on a completely different codebase to test with? If it uses different drivers, and is able to mount my phone, that'll lend some weight to my theory. Also, where could I find logs or error streams of what's going on when I plug the phone in? That may be able to point out a particular failure point.
spandey

Re: Can't mount an Android phone as a mass-storage device

Post by spandey »

I don't have andriod to test in my LMDE but my friend uses in Opensuse KDE and it works. It seems when you connect in USB it will ask charge or disk. answer disk and it works. I checked with him and he has Debian KDE and it works. So may be try KDE version of Mint.
If you are interesting in fixing LMDE itself, when you are done connecting Andriod in LMDE, just check dmessages in logs..
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Can't mount an Android phone as a mass-storage device

Post by remoulder »

Neophox wrote:Well, I've tested my phone with ubuntu 11.10, LMDE 2011/09, and Mint 9, all with no success
Neophox, as I said before you should only need to set the phone to mass storage on connection, this is all I need to do here with my Desire running Android 2.2.3 and it mounts just fine in mint 9, 10, 11 and 12 RC.
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
Neophox

Re: Can't mount an Android phone as a mass-storage device

Post by Neophox »

Unfortunately, when I connect the phone to the computer, the option to mount as a mass storage device is removed from the phone's pull-down menu. That's really the root of my problems. Like I said, it seems like the phone unmounts the sdcard, but the computer can't mount the card after this.
spandey

Re: Can't mount an Android phone as a mass-storage device

Post by spandey »

Neophox, After connecting your Andriod to your PC, it terminal ,
type

Code: Select all

lsusb
and post it here.

It's funny but sometimes it works. switch off your Andriod, Connect to PC and see the response from PC. Then switch Andriod on.
Neophox

Re: Can't mount an Android phone as a mass-storage device

Post by Neophox »

Okay. So, after connecting the phone and selecting mass media, I get

Code: Select all

Bus 004 Device 003: ID 1532:0009 Razer USA, Ltd 
Bus 004 Device 002: ID 046d:0a01 Logitech, Inc. USB Headset
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 002: ID 056a:00b1 Wacom Co., Ltd Intuos3 6x18
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 005: ID 1e3d:2093  
Bus 002 Device 004: ID 1058:1021 Western Digital Technologies, Inc. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0bb4:0ff9 High Tech Computer Corp. 
Bus 001 Device 003: ID 059f:1018 LaCie, Ltd 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 1, dev 5 is my phone. Rapidly mashing the up and enter keys as the phone tried it's handoff then defaulted to charging didn't show any change in the output.

As for connecting the phone when it's off, turning it on, then mounting, no luck. I tried lsusb with the phone off, then on, then after trying to mount as mass media, with no change.

Edit: Here's something interesting I found. Using dmesg | grep sd, I got a long list of messages related to /dev/sdf.

Code: Select all

[121645.464519] sd 13:0:0:0: Attached scsi generic sg6 type 0
[121645.494370] sd 13:0:0:0: [sdf] Attached SCSI removable disk
[121938.741259] sd 15:0:0:0: Attached scsi generic sg6 type 0
[121938.770743] sd 15:0:0:0: [sdf] Attached SCSI removable disk
[121988.014878] sd 15:0:0:0: [sdf] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
[121988.020861] sd 15:0:0:0: [sdf] No Caching mode page present
[121988.020866] sd 15:0:0:0: [sdf] Assuming drive cache: write through
[121988.030857] sd 15:0:0:0: [sdf] No Caching mode page present
[121988.030865] sd 15:0:0:0: [sdf] Assuming drive cache: write through
[121988.034119]  sdf: sdf1
[121988.977984] sd 15:0:0:0: [sdf] Unhandled sense code
[121988.977991] sd 15:0:0:0: [sdf]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[121988.977999] sd 15:0:0:0: [sdf]  Sense Key : Medium Error [current] 
[121988.978011] sd 15:0:0:0: [sdf]  Add. Sense: Unrecovered read error
[121988.978019] sd 15:0:0:0: [sdf] CDB: Read(10): 28 00 00 00 28 00 00 00 08 00
[121988.978038] end_request: I/O error, dev sdf, sector 10240
[121988.978049] Buffer I/O error on device sdf1, logical block 256
[121989.004913] Buffer I/O error on device sdf1, logical block 1024
[121989.004924] Buffer I/O error on device sdf1, logical block 1025
[121989.004929] Buffer I/O error on device sdf1, logical block 1026
[121989.004934] Buffer I/O error on device sdf1, logical block 1027
[121989.004939] Buffer I/O error on device sdf1, logical block 1028
[121989.004944] Buffer I/O error on device sdf1, logical block 1029
[121989.004949] Buffer I/O error on device sdf1, logical block 1030
[121989.004954] Buffer I/O error on device sdf1, logical block 1031
[121989.008846] sd 15:0:0:0: [sdf] Device not ready
[121989.008850] sd 15:0:0:0: [sdf]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[121989.008859] sd 15:0:0:0: [sdf]  Sense Key : Not Ready [current] 
[121989.008865] sd 15:0:0:0: [sdf]  Add. Sense: Medium not present
[121989.008874] sd 15:0:0:0: [sdf] CDB: Read(10): 28 00 00 00 40 00 00 00 08 00
[121989.008888] end_request: I/O error, dev sdf, sector 16384

I pruned a lot of it out. The block from "Device not ready" to "end_request" repeats, with different sectors. How can I interpret this? Going by what I assume are the thrown exceptions, it looks like the phone is trying to send some kind of data to the computer, and the HTC driver isn't handling it. Any thoughts?

Edit: Disregard that. Further research says the DRIVER_SENSE doesn't mean the HTC Sense driver, but is something declared in the kernel. However, I'm still pretty sure /dev/sdf is my phone, as it's the only 8 GB drive I have.
remoulder
Level 17
Level 17
Posts: 7621
Joined: Fri May 09, 2008 1:14 pm

Re: Can't mount an Android phone as a mass-storage device

Post by remoulder »

Neophox wrote:Buffer I/O error on device sdf1, logical block 1031
[121989.008846] sd 15:0:0:0: [sdf] Device not ready
If sdf is your sdcard which is likely this would confirm what you said in your first post, and seems to indicate that linux at least thinks there is a hardware problem, probably bad sectors on your sdcard even though you said you could read it separately. What file system is used on the card and how was it formatted?
[Edit] your original post and add [SOLVED] once your question is resolved.

“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
Neophox

Re: Can't mount an Android phone as a mass-storage device

Post by Neophox »

Hmm. I don't really know. It's a new phone, so I haven't formatted the card at all. I would assume it's probably NTFS, from the factory. I'll see about reformatting it once I can get my hands on a reader again to get some data off of it.
spandey

Re: Can't mount an Android phone as a mass-storage device

Post by spandey »

Neophox, sometimes USB in the front of PC won't work properly for these type of devices. But USB port's on the back, connected directly to Motherboard works. Also, don't use car charger cable or generic cable to connect the HTC. Rathter use the cable supplied with mains charger of phone. Hope it works.

If not, why don't you remove card from from HTC and connect this card directly to PC (may be using a card reader). See what is the format of card. If ti's not formatted connect it to Phone back and format it. It's good to have FAT32 with a 32Kb allocation unit for cards larger than 2 GB.
Neophox

Re: Can't mount an Android phone as a mass-storage device

Post by Neophox »

Alright, reformatting the card seems to have done the trick. Not sure how it was formatted before, but it works now. I'm marking this as solved.
Locked

Return to “Storage”