Jump to content


Photo

USB host/CIFS access to thumb drive

- - - - -

  • Please log in to reply
7 replies to this topic

#1
drewstiff

drewstiff

    Regular

  • Members
  • PipPip
  • 53 posts
  • Gender:Male
  • Devices:Galaxy Nexus
I am currently running MCR and although I'm not an Android "n00b" I'm not exactly a Linux master so was wondering if someone could give me some pointers on how to use my USB thumb drive with my GN.




I have the appropriate cable and the device shows up in dmesg as having attached successfully [sda]. So I kinda guessed that all I would have to do would be to mount it via CIFSmanager; so I put share path as /dev/sda and mount point was pre-filled as /mnt/cifs/sda which sounded perfectly reasonable. I left the username as guest and password and options both blank.




When I try to mount the drive I then get the following error:

"Mounting the share has failed with an error.

mount: invalid argument"




Anyone able to advise where I am going wrong?... Or have I completely got the wrong end of the stick?


  • 0

#2
SilentMobius

SilentMobius

    Enthusiast

  • MoDaCo Silver
  • PipPipPip
  • 275 posts
  • Gender:Male
  • Location:Reading
  • Devices:Galaxy Nexus, ASUS Transformer
  • Twitter:@SilentMobius
CIFS is a file system for mounting windows file shares (also known as Samba) it is nothing to do with mounting usb drives

  • 0

#3
drewstiff

drewstiff

    Regular

  • Members
  • PipPip
  • 53 posts
  • Gender:Male
  • Devices:Galaxy Nexus

CIFS is a file system for mounting windows file shares (also known as Samba) it is nothing to do with mounting usb drives


Well that would explain where I am going wrong then!


I knew CIFS was primarily for shares but I think that because the function was added to the ROM the same time as the USB host function I assumed it used CIFS to access the USB drive, hence enabling one enabled the other - but it appears this is a coincidence.

Okay then, now that is sorted - if my USB drive is connected as sda, then how do I access it? Do I need to set the mount in fstab?

If so, could I mount it as a subfolder of my "SDCARD" partition so that it is picked up by music apps etc.?


  • 0

#4
drewstiff

drewstiff

    Regular

  • Members
  • PipPip
  • 53 posts
  • Gender:Male
  • Devices:Galaxy Nexus

Well that would explain where I am going wrong then!


I knew CIFS was primarily for shares but I think that because the function was added to the ROM the same time as the USB host function I assumed it used CIFS to access the USB drive, hence enabling one enabled the other - but it appears this is a coincidence.

Okay then, now that is sorted - if my USB drive is connected as sda, then how do I access it? Do I need to set the mount in fstab?

If so, could I mount it as a subfolder of my "SDCARD" partition so that it is picked up by music apps etc.?






For anyone else who wasn't sure how to mount a usb drive, I was making it far more complicated than it needed to be and the following command will mount the usb device within a folder called "usbstick" on the sdcard:





mount -t vfat /dev/block/sda1 /sdcard/usbstick




Problem solved.


  • 0

#5
gandalf027

gandalf027

    Newbie

  • Members
  • Pip
  • 7 posts

For anyone else who wasn't sure how to mount a usb drive, I was making it far more complicated than it needed to be and the following command will mount the usb device within a folder called "usbstick" on the sdcard:





mount -t vfat /dev/block/sda1 /sdcard/usbstick




Problem solved.


Hey,

Can you give me some pointers to how can i do this? I know a bit of linux and i can use a termnal.
I have a USB OTG cable that works very well, at least in a SGS2. But in the SGS2 the pendrive (2GB Fat) is mounted auto.

In this one i cannot see it, it only appears in /d/usb devices file ... is there a way i can mount this?
Do i need to have themtp disabled or the usb debug on/off?

Thanks

  • 0

#6
drewstiff

drewstiff

    Regular

  • Members
  • PipPip
  • 53 posts
  • Gender:Male
  • Devices:Galaxy Nexus

Hey,

Can you give me some pointers to how can i do this? I know a bit of linux and i can use a termnal.
I have a USB OTG cable that works very well, at least in a SGS2. But in the SGS2 the pendrive (2GB Fat) is mounted auto.

In this one i cannot see it, it only appears in /d/usb devices file ... is there a way i can mount this?
Do i need to have themtp disabled or the usb debug on/off?

Thanks


I had OS Monitor app install so kept an eye on dmesg through that and saw that the usb stick was detected as [sda], then used the command I mention above (as su) in terminal in order to mount the drive. Then obviously you need to umount after.


If you are having problems they I might not be the best source of technical support for this particular issue but will do my best to help... I have not had to disable MTP and I have USB debugging on.


  • 0

#7
gandalf027

gandalf027

    Newbie

  • Members
  • Pip
  • 7 posts

I had OS Monitor app install so kept an eye on dmesg through that and saw that the usb stick was detected as [sda], then used the command I mention above (as su) in terminal in order to mount the drive. Then obviously you need to umount after.


If you are having problems they I might not be the best source of technical support for this particular issue but will do my best to help... I have not had to disable MTP and I have USB debugging on.


Thanks, i will install os monitor and see if i can figure it out. I'll give feedback later :)

  • 0

#8
Tibow

Tibow

    Newbie

  • Members
  • Pip
  • 9 posts

For anyone else who wasn't sure how to mount a usb drive, I was making it far more complicated than it needed to be and the following command will mount the usb device within a folder called "usbstick" on the sdcard:





mount -t vfat /dev/block/sda1 /sdcard/usbstick




Problem solved.



Hello,

tried that in terminal emulator, only got a mount : not such file or directory, don't really know what I'm doing wrong, kinda noob with command lines and stuff ^^

Regards

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users