Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Guide] USB Host

OP nerd65536

4th June 2012, 10:33 PM   |  #11  
OP Junior Member
Thanks Meter: 16
 
14 posts
Join Date:Joined: Jun 2009
More
Quote:
Originally Posted by setzer715

So I have been playing with this for a bit. I can get it to mount my old 4GB USB 2.0 flash drive but not my new 32GB USB3.0 flash drive. Do you think it's a 32GB thing or a USB3 thing? I would like to order a new drive for this but not sure which to eliminate.

I would prefer to use a 32GB drive if it's just a USB3 thing but if it's the size of the drive I don't want to deal with returns.

Any ideas?

Also it will not mount my SDCard reader with 16GB card in it.

I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.
In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.

Troubleshooting:

Do you get a specific error when using the "mount" command? If so, please paste the error message here.

Run
Code:
ls /dev/block/
to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?

Does the phone charge while everything is plugged in?
5th June 2012, 02:27 AM   |  #12  
setzer715's Avatar
Senior Member
Flag North Phoenix
Thanks Meter: 210
 
1,223 posts
Join Date:Joined: Jan 2009
More
Quote:
Originally Posted by nerd65536

I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.
In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.

Troubleshooting:

Do you get a specific error when using the "mount" command? If so, please paste the error message here.

Run

Code:
ls /dev/block/
to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?

Does the phone charge while everything is plugged in?

The error I get is "No such file or directory". It happens on this and my sdcard reader.

I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.

My 32GB flash drive is a high speed Lexor. I tried my wifes flash drive, her's is a Lexor 32GB USB3 but a slower rated one and I can see her's.

Further testing with my SDCard reader. I have a Transcend 8GB Class 6, A-Data 16GB Class 6 and Patriot 32GB Class 10 SDCards. I can see the 8GB and 32GB but not the 16GB.

Seems maybe a compatibility issue maybe? The card's/drives I couldn't read I tried formatting again, everything is FAT32. Who knows. At least I know most things work.
5th June 2012, 04:09 AM   |  #13  
OP Junior Member
Thanks Meter: 16
 
14 posts
Join Date:Joined: Jun 2009
More
Quote:
Originally Posted by setzer715

I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.

The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.

(The ideal solution would be to partition and format the drive so that it would behave like the others.)
Last edited by nerd65536; 5th June 2012 at 04:13 AM. Reason: grammar
6th June 2012, 01:00 AM   |  #14  
setzer715's Avatar
Senior Member
Flag North Phoenix
Thanks Meter: 210
 
1,223 posts
Join Date:Joined: Jan 2009
More
Quote:
Originally Posted by nerd65536

The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.

(The ideal solution would be to partition and format the drive so that it would behave like the others.)

Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?

I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.
6th June 2012, 08:15 AM   |  #15  
OP Junior Member
Thanks Meter: 16
 
14 posts
Join Date:Joined: Jun 2009
More
Quote:
Originally Posted by setzer715

Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?

I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.

It is possible to skip the partition table altogether and just start with the FAT32 data instead. This is what the manufacturer of the drive has done. (The drive doesn't have any partitions, so there is no first partition to be named "/dev/block/sda1")
You should be able to use the drive if you mount "sda" instead of "sda1". You can follow these instructions below to make it behave like the other drives:

If you have an Ubuntu LiveCD, boot from it, and open GParted (Partition Editor):
Choose your flash drive from the drop-down at the top right. Make absolutely sure you select the correct device (the size of the drive is listed), as all data on it will be erased.
In the menu: Device --> Create Partition Table... --> Apply.
Click on the "unallocated" space, to select it.
Next, menu: Partition --> New --> File system: FAT32 --> Add.
Finally, menu: Edit --> Apply All Operations

(When finished, close GParted and shutdown the liveCD)

The drive should now show up with the expected /dev/block/sda1 partition.
Last edited by nerd65536; 6th June 2012 at 08:20 AM. Reason: Clarity
The Following User Says Thank You to nerd65536 For This Useful Post: [ View ]
6th June 2012, 08:36 AM   |  #16  
setzer715's Avatar
Senior Member
Flag North Phoenix
Thanks Meter: 210
 
1,223 posts
Join Date:Joined: Jan 2009
More
I just mounted it as you previously described on sda instead of sda1 and it worked fine. I don't want to repartition it as I don't know if that will mess with the speeds. Who knows what Lexor did to make this thing so amazing fast but I want to keep it that way. It's nice to through 8gigs of movies on it in 1-2 minutes.

I'm sure partitioning has nothing to do with it and it's all based on hardware but you never know!
1st August 2012, 03:43 PM   |  #17  
UnkzDomain's Avatar
Senior Member
Flag Louisville
Thanks Meter: 4
 
409 posts
Join Date:Joined: Nov 2008
More
Would this work using a simple 5-pin male micro-USB to female USB adapter connected to a powered USB hub?
6th August 2012, 11:44 AM   |  #18  
Junior Member
Thanks Meter: 0
 
2 posts
Join Date:Joined: May 2010
Just ordered an HTC One S. YAY!


I'm a little scared about potentially frying my new toy by using the wrong cables...


Would an all in one cable do the job?
(ebay search for "Micro USB Host OTG Cable With USB power")


Seems to be the same as the DIY setup mentioned in the OP just all wrapped up in a single cable.


Thanks,

Mark
7th August 2012, 09:14 AM   |  #19  
arses's Avatar
Senior Member
Thanks Meter: 172
 
430 posts
Join Date:Joined: Mar 2010
I'm think if we buy an extended battery which have a micro usb cable (I forget the brand) exist on amazon.
We can solder a female to the cable and use battery as power source for phone and host.
What u think???

Sent from my One Sinderella using Tapatalk 2
18th August 2012, 03:26 PM   |  #20  
Junior Member
Flag Graz
Thanks Meter: 0
 
3 posts
Join Date:Joined: Aug 2012
More
Hi everybody,

First of all sorry for my englisch. I have a big problem with the USB otg function. An USB mouse works well but USB drives don't work. I have copied the text from terminal emulator:

app_162@android:/ $ export PATH=/data/local/bin:$PATH
app_162@android:/ $ su
app_162@android:/ # mkdir /mnt/sdcard/usb
mkdir: can't create directory '/mnt/sdcard/usb': File exists
2 /dev/block/sda1 /mnt/sdcard/usb <
mount: mounting /dev/block/sda1 on /mnt/sdcard/usb failed: No such file or directory
255|app_162@android:/ #

I also tried sda instead of sda1. No difference.
Please could anybody help me.

Post Reply Subscribe to Thread

Tags
usb, usb host
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes