# USB OTG



## bertmansk (Oct 23, 2011)

hey guys i finally purchased a USB OTG adapter.

my problem is, the TP doesnt seem to recoginze my flash drive.

some notes:
i have a USB y-cable which provdes the necessary power. ive tried connecting to both a computer port and a powered hub.
i have tried a USB keyboard, and it DOES work in the TP. so im pretty sure my OTG adapter is ok.
i have tried 2 flash drives. one usb2.0 16gb kingston reformatted to FAT32, and a usb3.0 corsair 32gb, also reformatted to fat32.
oh, and im running CM9 alpha 0.

i have googled for a while, i give up. can someone shed some light?


----------



## Alzest (Sep 10, 2011)

You need to type in some commands in the terminal app for the tp to mount and recognise your flash drive. I am sure someone might pop in with the command or u could just do some searching in this forum and find it urself as I'm currently not free...
Good luck mate


----------



## Tubbby (Jan 26, 2012)

I have this working...using GScript lite to mount FAT32 partitions manually.

While its claimed that android auto-mounts FAT32 partitions I've had a unique experience with it. I have OTG working with both my camera (FAT32) and WD Passport (drive has two partitions, one is FAT32) connected to a USB hub and powered via a Y cable. The camera gets auto-mounted but the FAT32 partition on the HDD doesn't, I assume because it has multiple partitions, one of which isn't FAT32? Maybe android only auto-mounts one FAT32 - who knows.

When booted up into Android (I'm using ICS) I load up my file manager, Astro and browse to /dev/block. At the bottom of this folder I can see files called sda (my harddrive) and its partitions, sda1 and sda2 and sba (my camera) and sba1, its partition.

*Note: *I found that they would show up more reliably when plugged into the TouchPad when its booting up, I don't know if that initialises them correctly or whatever.

Anyway, getting to the point. What I did was create a new folder on my SD card called "external" where I will mount that /dev/block volume to so I can access it. I downloaded GScript lite, and made a new script with the following command:


```
<br />
mount -t -o rw /dev/block/sda1 /sdcard/external<br />
```
When I run this script (when my hard drive is connected of course) it mounts the sda1 partition (trial and error to find out if that or sda2 was the FAT32 partition on it) to the external folder I made. I can then do what I like with the files on the drive - success!

I actually then created a script to mount both my camera and my hard drive from my usb hub at the same time, and put this as a shortcut (using the GSCript widget) on my home screen - so all I need to do to mount both my drives is have them connected, and hit a shortcut.

For that, I just entered this into GScript:


```
<br />
mount -t vfat -o rw /dev/block/sda1 /sdcard/external<br />
mount -t vfat -o rw /dev/block/sdb1 /sdcard/camera<br />
```
I can then just transfer things between them when on the road, simples.

I hope this helps.


----------



## bertmansk (Oct 23, 2011)

thank you both for your replies. tubby, i see thats your first post... and its quite an impressive one, at least to me. 

so i began to follow your instructions, and i did find the sda and sda1 files. but, while searching for them, i stumbled upon the directory */mnt/usbdisk. this is my flash drive!* i found all my files in there, without needing to mount anything. i can modify and read all files, no problem... i created a shortcut to the directory and put it on my home screen.

if for whatever reason i ever have any problems with my accidental method, i'll come back to your post here.

thanks again.

edit* what about un-mounting? do i need to unmount the drive before unplugging? or is it safe to just unplug the drive as long as nothing is reading/writing?


----------



## skunkfu (Sep 2, 2011)

Yeah I realized eventually that external storage automatically mounted in */mnt/usbdisk*!

To the un-mounting part, I was under the impression that with Honeycomb on-wards, it poped up a notification saying that external storage has been plugged in and selecting it takes you to the directory, then you can un-mount the same way?

Can green, dalingrin or others possibly enlighten us on this?

Thanks!


----------



## Tubbby (Jan 26, 2012)

No problem bertmansk, glad to help! I actually found that while my camera auto-mounts to /mnt/usbdisk, my HDD never would so I needed to take the manual measures above.

Good stuff that you worked it out easily though!

And yes it was my first post on RootzWiki, I'm normally on XDA but thought I could answer your question well enough to make an account. Service or what huh!


----------



## skunkfu (Sep 2, 2011)

Thanks from me tubbby, need more like you


----------

