OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> C3000 Usb Host: Auto Mount And Umount Usb Hdd
DreamTheater
post Jan 4 2005, 05:21 AM
Post #1





Group: Members
Posts: 44
Joined: 3-January 05
From: Austin, TX
Member No.: 6,104



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.
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
bam
post Jul 20 2005, 10:29 PM
Post #2





Group: Members
Posts: 1,213
Joined: 9-June 05
From: Gobi Desert, Mongolia
Member No.: 7,306



cant seem to get it to automount....I followed word for word, I can manually mount it but automount...forget it?
Go to the top of the page
 
+Quote Post
Meanie
post Jul 20 2005, 11:14 PM
Post #3





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



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
Go to the top of the page
 
+Quote Post
bam
post Jul 20 2005, 11:38 PM
Post #4





Group: Members
Posts: 1,213
Joined: 9-June 05
From: Gobi Desert, Mongolia
Member No.: 7,306



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)
Go to the top of the page
 
+Quote Post
Meanie
post Jul 22 2005, 10:45 PM
Post #5





Group: Members
Posts: 2,808
Joined: 21-March 05
From: Sydney, Australia
Member No.: 6,686



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.
Go to the top of the page
 
+Quote Post

Posts in this topic
DreamTheater   C3000 Usb Host: Auto Mount And Umount Usb Hdd   Jan 4 2005, 05:21 AM
orange   hi DreamTheater thx for your instructions but i c...   Jan 4 2005, 08:48 AM
DreamTheater   Oops sorry. just corrected.   Jan 4 2005, 09:12 AM
orange   had a typo in one of the files it now works great...   Jan 6 2005, 04:52 PM
pierro78   sorry if I am a little off topic but can the C3000...   Jan 6 2005, 07:01 PM
DreamTheater   I once tried my friend's 2.5inch bus-power typ...   Jan 8 2005, 12:03 AM
spartan   I followed the scripts as-written. However, they d...   Jan 15 2005, 09:53 AM
tcv   What have you tried to mount an iPod? Does this o...   Jan 15 2005, 03:35 PM
DreamTheater   spartan, Those scripts above are only for automat...   Jan 15 2005, 04:51 PM
spartan   Thanks a lot for the help and links. Evidently, th...   Jan 16 2005, 10:55 AM
daXd   I have two following problems with mounting SL-C30...   Jan 20 2005, 09:22 AM
papercrane   Thanks much, DreamTheater, works like a charm. Now...   Feb 7 2005, 11:02 AM
papercrane   Hmmm, one caveat, though. The Music player won...   Feb 9 2005, 10:18 AM
papercrane   Quick update, symlinking the USB HD mount point to...   Feb 16 2005, 01:26 PM
benplaut   sorry to sound like such a n00b here (i'm used...   Jun 13 2005, 08:12 PM
bam   cant seem to get it to automount....I followed wor...   Jul 20 2005, 10:29 PM
Meanie   QUOTE(bam @ Jul 21 2005, 04:29 PM)cant seem t...   Jul 20 2005, 11:14 PM
bam   QUOTE(Meanie @ Jul 20 2005, 11:14 PM)QUOTE(ba...   Jul 20 2005, 11:38 PM
Meanie   QUOTE(bam @ Jul 21 2005, 05:38 PM)QUOTE(Meani...   Jul 22 2005, 10:45 PM
Cagilaba   I just got a 4GB Sitecom Mini Memory Drive (MD-202...   Oct 10 2005, 01:17 PM
Mac   Hi Meanie, I installed your app automounter-c30...   Oct 13 2005, 07:09 AM
bkudria   I am unfortunately having the same problem on my 3...   Oct 15 2005, 09:43 AM
bkudria   I emailed Meanie, and he recommends installing the...   Oct 21 2005, 04:27 PM
Mac   I installed the 0.4.2 ipk, and for my C3000 the si...   Oct 22 2005, 12:44 AM
glennfoster   Does this page help? Cant Mount iPod Error G   Feb 21 2006, 02:37 AM
Mac   Nice try Glennfoster, but your link has nothing to...   Feb 21 2006, 10:42 AM
glennfoster   QUOTE(Mac @ Feb 21 2006, 10:42 AM)Nice try Gl...   Mar 4 2006, 06:34 AM
Mac   this is solved for me by installing the automounte...   Feb 24 2006, 04:14 AM
Mac   if you read the thread you'll notice that it h...   Mar 4 2006, 08:42 AM
mikew   Can anyone tell me how I gain access to a storage ...   Apr 27 2006, 06:54 AM
kurochka   Meanie, Your site indicates that there is a 0.50 ...   Nov 8 2006, 06:54 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th December 2014 - 12:50 AM