OESF Portables Forum

Everything Else => Sharp Zaurus => Model Specific Forums => Distros, Development, and Model Specific Forums => Archived Forums => C1000/3x00 General discussions => Topic started by: DreamTheater on January 04, 2005, 08:21:13 am

Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: DreamTheater on January 04, 2005, 08:21:13 am
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: [Select]
cd /mnt
mkdir usbhdd

2) Create a file /etc/hotplug/usb/usb-storage as follows.  chmod it as 755.
Code: [Select]
#!/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: [Select]
#!/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: [Select]
/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.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: orange on January 04, 2005, 11:48:01 am
hi DreamTheater

thx for your instructions but i cant get it running  

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
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: DreamTheater on January 04, 2005, 12:12:32 pm
Oops sorry. just corrected.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: orange on January 06, 2005, 07:52:25 pm
had a typo in one of the files it now works great!  

shame on sharp that they did not put that in by sock
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: pierro78 on January 06, 2005, 10:01:02 pm
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  )
(sorry if my english is not so good btw)
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: DreamTheater on January 08, 2005, 03:03:02 am
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 (http://www.cyberpowersystems.com/hub420mp.htm)

This can be found at BestBuy.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: spartan on January 15, 2005, 12:53:46 pm
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.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: tcv on January 15, 2005, 06:35:21 pm
What have you tried to mount an iPod?

Does this offer any help?

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

Why not?
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: DreamTheater on January 15, 2005, 07:51:03 pm
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: [Select]
# fdisk -l /dev/sda
If you can see the disk, then you may be able to manually mount it.
Code: [Select]
mount -t vfat -o umask=000,noatime,iocharset=utf8,codepage=932 /dev/sda1 /mnt/usbhdd
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: spartan on January 16, 2005, 01:55:45 pm
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: [Select]
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...
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: daXd on January 20, 2005, 12:22:44 pm
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.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: papercrane on February 07, 2005, 02:02:35 pm
Thanks much, DreamTheater, works like a charm. Now I just need to get my USB HD Enclosure with a built-in battery. ;-)
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: papercrane on February 09, 2005, 01:18:44 pm
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 (https://www.oesf.org/forums/index.php?showtopic=10658)
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: papercrane on February 16, 2005, 04:26:15 pm
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".
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: benplaut on June 14, 2005, 12:12:42 am
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?  

<<edit>>

Tree!Explorer  

--

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    
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: bam on July 21, 2005, 02:29:58 am
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Meanie on July 21, 2005, 03:14:34 am
Quote
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=89002\"][{POST_SNAPBACK}][/a][/div]

why dont you try my automounter package?
it can mount up to four disks if you have a usb hub
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: bam on July 21, 2005, 03:38:46 am
Quote
Quote
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=89002\"][{POST_SNAPBACK}][/a][/div]

why dont you try my automounter package?
it can mount up to four disks if you have a usb hub
[div align=\"right\"][a href=\"index.php?act=findpost&pid=89003\"][{POST_SNAPBACK}][/a][/div]

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)
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Meanie on July 23, 2005, 02:45:04 am
Quote
Quote
Quote
cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=89002\"][{POST_SNAPBACK}][/a][/div]

why dont you try my automounter package?
it can mount up to four disks if you have a usb hub
[div align=\"right\"][a href=\"index.php?act=findpost&pid=89003\"][{POST_SNAPBACK}][/a][/div]

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)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=89004\"][{POST_SNAPBACK}][/a][/div]

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  I never had a Linux desktop before. My Z is my first linux desktop. well kinda. I think of it as a mini Laptop.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Cagilaba on October 10, 2005, 05:17:48 pm
I just got a 4GB Sitecom Mini Memory Drive (MD-202) http://www.sitecom.com/products_info.php?p...id=323&grp_id=1 (http://www.sitecom.com/products_info.php?product_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: https://oesf.org/index.php?title=Formating_..._Simultaneously (https://oesf.org/index.php?title=Formating_A_Microdrive_For_Use_With_Cxx0_And_Windows_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).
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Mac on October 13, 2005, 11:09:48 am
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 ?
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: bkudria on October 15, 2005, 01:43:48 pm
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
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 ?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=99191\"][{POST_SNAPBACK}][/a][/div]
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: bkudria on October 21, 2005, 08:27:11 pm
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 (http://www.users.on.net/~hluc/myZaurus/stuff/automounter-c3000_0.4.2_arm.zip)

Unzip, install, and it should work!
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Mac on October 22, 2005, 04:44:21 am
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...).
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: glennfoster on February 21, 2006, 05:37:47 am
Does this page help?

Cant Mount iPod Error (http://www.gabalot.co.uk)



G
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Mac on February 21, 2006, 01:42:19 pm
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"...
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Mac on February 24, 2006, 07:14:00 am
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?
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: glennfoster on March 04, 2006, 09:34:29 am
Quote
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"...
[div align=\"right\"][a href=\"index.php?act=findpost&pid=115609\"][{POST_SNAPBACK}][/a][/div]

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.
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: Mac on March 04, 2006, 11:42:03 am
if you read the thread you'll notice that it has nothing to do with iPods...
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: mikew on April 27, 2006, 10:54:11 am
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
Title: C3000 Usb Host: Auto Mount And Umount Usb Hdd
Post by: kurochka on November 08, 2006, 09:54:07 pm
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.