Help - Search - Members - Calendar
Full Version: C3000 Usb Host: Auto Mount And Umount Usb Hdd
OESF Forums > Distros, Development, and Model Specific Forums > Model Specific Forums > C1000/3x00 General discussions
DreamTheater
I tested this with C3000 (ROM 1.01 JP). Use a USB mini-A cable to connect C3000 with your USB mass-storage device.

[Procedures]
1)
CODE
cd /mnt
mkdir usbhdd


2) Create a file /etc/hotplug/usb/usb-storage as follows. chmod it as 755.
CODE
#!/bin/sh
. /etc/hotplug/hotplug.functions
if [ ! -L /var/run/usb/%proc%bus%usb%* ]; then
 mesg Try to Mount
 mount /mnt/usbhdd
 if [ $? = 0 ]; then
   ln -s /etc/hotplug/usb/usb-storage.off $REMOVER
   mesg make REMOVER in $REMOVER
 fi
fi


3) Create a file /etc/hotplug/usb/usb-storage.off as follows. chmod it as 755.
CODE
#!/bin/sh
. /etc/hotplug/hotplug.functions
mesg Removing /mnt/usbhdd
umount /mnt/usbhdd
rmmod usb-storage


4) Add the following one line to /etc/fstab
CODE
/dev/sda1       /mnt/usbhdd     vfat    noauto,umask=000,noatime,iocharset=utf8,codepage=932    0  0


5) Connect your USB mass-storage device, you should be able to see it at /mnt/usbmem in a second you pluged the device. This is also visible from Sharp's qtopia GUI File manager.
orange
hi DreamTheater

thx for your instructions but i cant get it running sad.gif

I followed the Procedure you described but nothing happens

are you sure that the fstab line is correct? cuz first we create /mnt/usbhdd but then you talk about /mnt/usbmem ?

but I tried both but none work for me (I use the same GoldX Cable)

thx
DreamTheater
Oops sorry. just corrected.
orange
had a typo in one of the files it now works great! biggrin.gif

shame on sharp that they did not put that in by sock
pierro78
sorry if I am a little off topic but can the C3000 USB port provide enough power to power a small 1.8" unpowered hard drive ? like the 6000 does for the (quite "cheap") 1.8" archos unpowered drives ? has anybody tried that ?

(I suppose it should if it has same specs as the 6000 USB port as everybody says but I'd like to be sure of that wink.gif )
(sorry if my english is not so good btw)
DreamTheater
I once tried my friend's 2.5inch bus-power type hard drive, but my C3000 couldn't power it. I am not sure how much current we can draw from C3000 USB host. It could be smaller than that of 6000, because C3000's USB host functionality is inside Intel PXA270 chip.
It looks like Archos bus-powered 1.8 inch hard drive is using Hitachi's drive which typically requires 200 - 300 mA, where typical 2.5 inch drive requires 500mA range.

The other option is to use MP3 player type hard drives or to use battery powered USB hub.

http://www.cyberpowersystems.com/hub420mp.htm

This can be found at BestBuy.
spartan
I followed the scripts as-written. However, they do not work. The FSTAB line works correctly, as I can mount and umount a USB key and a camera. All files have /mnt/usbstorage instead of /mnt/usbhdd ; either way, the auto-mount doesn't work.

I cannot mount, however, an iPod, period. It is FAT32 formatted.

Any advice for either problem would be greatly appreciated.
tcv
What have you tried to mount an iPod?

Does this offer any help?

http://people.csail.mit.edu/people/adonovan/hacks/ipod.html

Why not?
DreamTheater
spartan,

Those scripts above are only for automatic mount/umount. Device driver should be loaded automatically without those scripts.
So, when you plug in your iPod, try lsmod command to see if usb-storage module is really loaded. If it doesn't show usb-storage, it means iPod is not Linux usb-storage compliant. Sorry, I don't have iPod myself, so don't know the detail.

If you can see usb-storage, then try the below to see what it shows. Note that Linux treats USB mass storage as SCSI device.
CODE
# fdisk -l /dev/sda


If you can see the disk, then you may be able to manually mount it.
CODE
mount -t vfat -o umask=000,noatime,iocharset=utf8,codepage=932 /dev/sda1 /mnt/usbhdd
spartan
Thanks a lot for the help and links. Evidently, the partition the iPod actually uses for data is partition 2. In turn, via telnet:

CODE
bash-2.05# /sbin/lsmod
Module                  Size  Used by
usb-storage           103328   0  (unused)
usb_ohci_pxa27x        21696   0  (unused)
usbcore                63264   1  [usb-storage usb_ohci_pxa27x]
pxa_bi                 24912   0  (unused)
storage_fd            100336   0  (unused)
usbdcore               35504   0  [pxa_bi storage_fd]
usbdmonitor             5488   0
usb-monitor             6496   0
sharp_mmcsd_m          41008   1
prism2_cs              69584   1
p80211                 18864   1  [prism2_cs]
bash-2.05# /sbin/fdisk -l /dev/sda

Disk /dev/sda: 15.0 GB, 15000330240 bytes
255 heads, 63 sectors/track, 1823 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1         5     40131    0  Empty
/dev/sda2   *         6      1823  14603085    b  Win95 FAT32
/dev/sda3             1         1         0    0  Empty
Partition 3 does not end on cylinder boundary.
bash-2.05# mount -t vfat -o umask=000,noatime,iocharset=utf8,codepage=932 /dev/sda2 /mnt/usbstorage
bash-2.05#


Everything works fine. Thanks again. Now I can use it as a portable video player...
daXd
I have two following problems with mounting SL-C3000 as a USB mass storage.

1) When I plug the cable into the Zaurus, "AlertUSBStarage" warning window is displayed. Then I have to click on "Yes" and "AlertUSBStorageConnection" warning is displayed. I click on "OK" and remove the cable. Than I plug the cable in again and Zaurus display "Comunicating..." screen and it is OK. But everytime I have to go through two warning windows and "plug in -> remove -> plug in cable again" way.

2) Sometimes is zaurus mounted as read-only. Well, it is not exactly mounted as read-only, mount command shows rw, but it is impossible to write to mounted Zaurus. I am not able to predicate when I could write to Zaurus and when not. And when Zaurus in "writable", Midnight Commander says "it is impossible to change file permissions" after every file.

One note for Fedora users. Zaurus is mounted as /dev/sda on my FC1 box.
papercrane
Thanks much, DreamTheater, works like a charm. Now I just need to get my USB HD Enclosure with a built-in battery. ;-)
papercrane
Hmmm, one caveat, though. The Music player won't see my USB drive. Everything else sees it (even the Movie player sees it!), but the Music player won't. Any ideas?

See my other post
papercrane
Quick update, symlinking the USB HD mount point to /mnt/card causes the Music Player to say an SD Card is inserted (which is actually the USB HD). All of the other apps still say "Storage /dev/sda1".
benplaut
sorry to sound like such a n00b here (i'm used to Linux desktop systems, which readily give you root access, and let you actually see the filesystem)

How do i save to directories other than /home/[whatever name it has]/ ... that seems to be the only thing that the Z recognizes,,,

when i "cd" in the bash prompt, the prom[t remains the same, not indicating the new directory...

what am i doing wrong? sad.gif

<<edit>>

Tree!Explorer tongue.gif

--

anyway... could i motify this for USB thumdrives for every time it says "usbhdd", replace it with "usbstorage"... that's what thumbdrives are mounted to

i think ph34r.gif unsure.gif
bam
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
Meanie
QUOTE(bam @ Jul 21 2005, 04:29 PM)
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
*


why dont you try my automounter package?
it can mount up to four disks if you have a usb hub
bam
QUOTE(Meanie @ Jul 20 2005, 11:14 PM)
QUOTE(bam @ Jul 21 2005, 04:29 PM)
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
*


why dont you try my automounter package?
it can mount up to four disks if you have a usb hub
*



i tried you script too, I pm'ed you:)

edit: ok way wierd now it works....when will I quit being a pain in the arse? Although a nice explaination of your script would be nice, how it works, how the system knows to run it etc...(for those who want to learn this)
Meanie
QUOTE(bam @ Jul 21 2005, 05:38 PM)
QUOTE(Meanie @ Jul 20 2005, 11:14 PM)
QUOTE(bam @ Jul 21 2005, 04:29 PM)
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
*


why dont you try my automounter package?
it can mount up to four disks if you have a usb hub
*



i tried you script too, I pm'ed you:)

edit: ok way wierd now it works....when will I quit being a pain in the arse? Although a nice explaination of your script would be nice, how it works, how the system knows to run it etc...(for those who want to learn this)
*



well, actually, I am pretty new to linux myself. I've always been a Windoze user for the desktop and Solaris for servers. Most my linux knowledge comes from reading TLD project (the linux documentation) and googling webforums. I really recommend reading the online version of TLDP (www.tldp.org) or buying the paperback hardcopy. It's really worth a read.

Anyway, what you need to read up on is the hotplug mechanism in Linux. It's basically the way Linux handles plug'n'play. My script is just a hook into the hotplug mechanism which checks each the available scripts when it detects a device being plugged in and runs the associated script when it is unplugged. The script just needs to define a matching rule for what devices it needs to be run for and then does whatever is required to configure the device, in the case for a HDD, just mount it appropriately.

My script basically assumes there is the possibility to mount four harddrives so it checks for that and attempts to mount more drives when they are plugged in. It also checks that the drive is not already mounted before it attempts to mount a drive. Also, I have taken the two most common options that are used to partition and format harddisk so if the disk falls into that category, the script is able to mount it, but if its one of the rarer cases, then it will fail to automount it and you will need to manually mount the disk.

The two most common type of partitions that I use quite often are:

1. the disk has one partition which is the primary partition
2. the disk has one or more partitions which are secondary partitions on a primary partition.

For case 2, only the first partition is mounted. The remaining partitions need to be mounted manually if there are any.

Most USB memory sticks, etc. will most likely be 1 and some MP3 players are 2. but some are 1. as well. For USB harddisk, it depends how people partition them, but again, 1. and 2. are the most common options I have seen. I personally use 2. for my USB disks. This way the disk will not interfere with Windows drive mapping when they are plugged into a Windows system. Windows reshuffles the drive letters, all primary partitions get drive letters assigned first before secondary partitions. So if you have C: D: E: and E: being a secondary partitions, if you plug in a USB disk which has a primary partition, the USB disk becomes E: and your former E: is reassigned as F:. If the USB disk has a drive on a secondary partition, then the USB disk is assigned the drive letter F: and E: is undisturbed.

Also, the Z by default only recognises linux native (ext2/ext3) and FAT/FAT32 (vfat, fat32, dos). If your disk is formatted using a different filesystem type, then the Z won't be able to mount it unless you install drivers for those types. I have installed the ntfs drivers as well so I can read Windows 2000/XP NTFS partitions as well.

Use google. There is a lot of info about linux out there. That's how I learned it smile.gif I never had a Linux desktop before. My Z is my first linux desktop. well kinda. I think of it as a mini Laptop.
Cagilaba
I just got a 4GB Sitecom Mini Memory Drive (MD-202) http://www.sitecom.com/products_info.php?p...id=323&grp_id=1 . It's a small 1" hard drive.

Had some problems to start with -- for one thing it wouldn't spin up on battery power (only worked connected to a powered USB hub -- though I didn't try with Zaurus on external power). Then for the C1000 to actually mount it and write to it properly I had to eventually reformat the drive according to these useful instructions: http://oesf.org/index.php?title=Formating_..._Simultaneously

Seems to be working fine... not sure how long it will last, with its tiny mechanical parts...

Anyway, it automounts to /mnt/usbhdd now. But when my Zaurus suspends, the drive unmounts (in fact, when I resume the Z, the drive doesn't even show as connected when I do fdisk -l). Is there any way to avoid this? Is it bad for the drive? Can it cause data corruption / data loss (other than if the drive is in the middle of writing).
Mac
Hi Meanie, I installed your app automounter-c3000_0.4.1_arm.ipk on a C300 but it doesn't work for me, the usb-stick I tried is recognised but doesn't automount. I can manually mount them without a problem...

I also tried the usb-storage script, same thing, the USB-stick does not automount under the files tab... any idea ?
bkudria
I am unfortunately having the same problem on my 3100...the drive is recognized, but not mounted. I can mount it with mount /mnt/usbhdd, but it will not mount manually? It does seems to work for some people, but not for others...any help is appreciated!

QUOTE(Mac @ Oct 13 2005, 03:09 PM)
Hi  Meanie, I installed your app  automounter-c3000_0.4.1_arm.ipk on a  C300 but it doesn't work for me, the usb-stick I tried is recognised but doesn't automount. I can manually mount them without a problem...

I also tried the usb-storage script, same thing, the USB-stick does not automount under the files tab... any idea ?
*
bkudria
I emailed Meanie, and he recommends installing the 0.4.2 ipk. He is right, it now works great! The ipk is here:

http://www.users.on.net/~hluc/myZaurus/stu...0_0.4.2_arm.zip

Unzip, install, and it should work!
Mac
I installed the 0.4.2 ipk, and for my C3000 the situation isn't any better (actually is worse). The light on my usb stick keeps blinking so it looks like it's in a loop trying to mount it (and no icon shows up under the files tab...).
glennfoster
Does this page help?

Cant Mount iPod Error

smile.gif

G
Mac
Nice try Glennfoster, but your link has nothing to do with the problem, and I don't think anyone will appreciate it that you spam the board with your link, trying to sell this "email"...
Mac
this is solved for me by installing the automounter-C3000 version 0.4.6. , USB sticks are mounted OK now.

one question, is it possible to unmount using the GUI or do I have to unmount using the CLI?
glennfoster
QUOTE(Mac @ Feb 21 2006, 10:42 AM)
Nice try Glennfoster, but your link has nothing to do with the problem, and I don't think anyone will appreciate it that you spam the board with your link, trying to sell this "email"...
*


I didnt spam the board, simply i moved it from free hosting to paid for hosting so i can build up information about iPods!

doh!

Oh, and thats what that email pays for, my hosting.

And yes my method does work providing your iPod isnt broken.
Mac
if you read the thread you'll notice that it has nothing to do with iPods...
mikew
Can anyone tell me how I gain access to a storage device attached to the USB port.

Storage tab in System Info identifies the card reader as
Vendor:
Product: USB OHCI Root Hub
Class: HUB
ID: 0000/0000
Driver: hub

And the SD card as

Product: CS8819A2
Class: Mass Storage
ID: 04cf/8819
Driver usb-storage

But I can't access them via any file explorer.

Does this mean they are not mounted or it does not have the correct drivers to access them.

Any help would be apreciated as I want to use the new functions now that I have upgraded from a C760 to C3200.


Mike
kurochka
Meanie,

Your site indicates that there is a 0.50 version of automounter-c3000_0.5.0_arm.ipk
However, the file isn't there. There is automounter-c3000_0.4.9_arm.zip however.
There are some other links to files that are broken but I can't remember which ones.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.