linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb-storage
@ 2004-03-09 17:10 Luca T.
  2004-03-09 17:21 ` usb-storage Sabharwal, Atul
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Luca T. @ 2004-03-09 17:10 UTC (permalink / raw)
  To: linux-hotplug

Hello,
i would like to understand how hotplugging works, i did some experiments 
but without success.
If i did understand well, when i connect an usb-disk the script 
/etc/hotplug/usb/usb-storage should be fired... but this doesn't seem to 
happen.
I put a line inside it ( echo "test" >/tmp/test ) but the file is never 
created when i plug or unplug my usb-disk.
Why?

Thank you,
  Luca



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
@ 2004-03-09 17:21 ` Sabharwal, Atul
  2004-03-09 19:09 ` usb-storage Luca T.
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Sabharwal, Atul @ 2004-03-09 17:21 UTC (permalink / raw)
  To: linux-hotplug

 
This could be a configuration problem. Udev release 21, sysfs should be
mounted, udev rules in /etc/udev/udev.rules etc. Also, a valid rule in
udev.rules which would program your usb-storage device.

I was seeing the same problem but as I installed the above programs, it
went away.
--
Atul

-------------------------------------------------------------
P.S:  All opinions are my personal opinion(s) & responsibility and do
not represent the view of my employer ( Intel Corporation ).

-----Original Message-----
From: linux-hotplug-devel-admin@lists.sourceforge.net
[mailto:linux-hotplug-devel-admin@lists.sourceforge.net] On Behalf Of
Luca T.
Sent: Tuesday, March 09, 2004 9:11 AM
To: linux-hotplug-devel@lists.sourceforge.net
Subject: usb-storage

Hello,
i would like to understand how hotplugging works, i did some experiments

but without success.
If i did understand well, when i connect an usb-disk the script 
/etc/hotplug/usb/usb-storage should be fired... but this doesn't seem to

happen.
I put a line inside it ( echo "test" >/tmp/test ) but the file is never 
created when i plug or unplug my usb-disk.
Why?

Thank you,
  Luca



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
  2004-03-09 17:21 ` usb-storage Sabharwal, Atul
@ 2004-03-09 19:09 ` Luca T.
  2004-03-09 19:46 ` usb-storage Greg KH
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca T. @ 2004-03-09 19:09 UTC (permalink / raw)
  To: linux-hotplug

Sabharwal, Atul wrote:

>This could be a configuration problem. Udev release 21, sysfs should be
>mounted, udev rules in /etc/udev/udev.rules etc. Also, a valid rule in
>udev.rules which would program your usb-storage device.
>
>I was seeing the same problem but as I installed the above programs, it
>went away.
>
Hmmm,
i don't have this udev thing nor sysfs mounted (i believe, not sure).
(Btw, i am running Mandrake 9.2)
So... i do not have udev nor sysfs but still, when i plug my usb-webcam, 
a new icon appears on my desktop. This means that in some way mandrake 
is doing it. I just want to understand how this is happening to make my 
custom scripts run instead.
Since i have /etc/hotplug i thought this was how.
Any idea?

Thanx,
   Luca



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
  2004-03-09 17:21 ` usb-storage Sabharwal, Atul
  2004-03-09 19:09 ` usb-storage Luca T.
@ 2004-03-09 19:46 ` Greg KH
  2004-03-09 22:12 ` usb-storage Luca T.
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2004-03-09 19:46 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Mar 09, 2004 at 06:10:35PM +0100, Luca T. wrote:
> Hello,
> i would like to understand how hotplugging works, i did some experiments 
> but without success.
> If i did understand well, when i connect an usb-disk the script 
> /etc/hotplug/usb/usb-storage should be fired... but this doesn't seem to 
> happen.

What kernel are you using?

> I put a line inside it ( echo "test" >/tmp/test ) but the file is never 
> created when i plug or unplug my usb-disk.
> Why?

On 2.4 that script would only be run when the driver is first loaded.
When the device is removed, the driver is never unloaded.

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
                   ` (2 preceding siblings ...)
  2004-03-09 19:46 ` usb-storage Greg KH
@ 2004-03-09 22:12 ` Luca T.
  2004-03-09 22:40 ` usb-storage Greg KH
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Luca T. @ 2004-03-09 22:12 UTC (permalink / raw)
  To: linux-hotplug

Ok,
as Greg suggested the script is fired only the first time an usb-disk is 
plugged in.
I verified this by unloading the usb-storage kernel module and then 
plugging in an usb-disk. The script has been executed correctly.
Now, i need a way to detect when an usb-disk is plugged in and out, not 
only the first time, but everytime this happens.
I noticed that not only the usb-storage module isn't unloaded when the 
usb-disk is removed but it also leaves the device-file (for instance 
/dev/sda). So i have no way to know when the disk is removed :(

Any idea that could help me?

Thank you again,
   Luca



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
                   ` (3 preceding siblings ...)
  2004-03-09 22:12 ` usb-storage Luca T.
@ 2004-03-09 22:40 ` Greg KH
  2004-03-09 22:49 ` usb-storage Luca T.
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2004-03-09 22:40 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Mar 09, 2004 at 11:12:54PM +0100, Luca T. wrote:
> Ok,
> as Greg suggested the script is fired only the first time an usb-disk is 
> plugged in.
> I verified this by unloading the usb-storage kernel module and then 
> plugging in an usb-disk. The script has been executed correctly.
> Now, i need a way to detect when an usb-disk is plugged in and out, not 
> only the first time, but everytime this happens.

You will get a scsi event every time this happens, but this is only in
the 2.6 kernel.  2.4 does not support this.

> I noticed that not only the usb-storage module isn't unloaded when the 
> usb-disk is removed but it also leaves the device-file (for instance 
> /dev/sda). So i have no way to know when the disk is removed :(

Only udev manages the /dev entries, unless you are using devfs.  I'm
guessing you aren't using udev or devfs?  If so, the device nodes are
always there.

Hope this helps,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
                   ` (4 preceding siblings ...)
  2004-03-09 22:40 ` usb-storage Greg KH
@ 2004-03-09 22:49 ` Luca T.
  2004-03-09 22:59 ` usb-storage Greg KH
  2004-03-10  5:06 ` usb-storage Mika Penttilä
  7 siblings, 0 replies; 9+ messages in thread
From: Luca T. @ 2004-03-09 22:49 UTC (permalink / raw)
  To: linux-hotplug

Greg KH wrote:

> You will get a scsi event every time this happens, but this is only in
>
>the 2.6 kernel.  2.4 does not support this.
>  
>
:(

>Only udev manages the /dev entries, unless you are using devfs.  I'm
>guessing you aren't using udev or devfs?  If so, the device nodes are
>always there.
>  
>
I'm using devfs, the device-files are dinamically created and removed... 
beside for the usb-disks, they are dinamically created, but not removed 
once the device has been unplugged :(

Thanx,
   Luca



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
                   ` (5 preceding siblings ...)
  2004-03-09 22:49 ` usb-storage Luca T.
@ 2004-03-09 22:59 ` Greg KH
  2004-03-10  5:06 ` usb-storage Mika Penttilä
  7 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2004-03-09 22:59 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Mar 09, 2004 at 11:49:04PM +0100, Luca T. wrote:
> I'm using devfs, the device-files are dinamically created and removed... 
> beside for the usb-disks, they are dinamically created, but not removed 
> once the device has been unplugged :(

Then go bug the devfs developers :)

Good luck,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: usb-storage
  2004-03-09 17:10 usb-storage Luca T.
                   ` (6 preceding siblings ...)
  2004-03-09 22:59 ` usb-storage Greg KH
@ 2004-03-10  5:06 ` Mika Penttilä
  7 siblings, 0 replies; 9+ messages in thread
From: Mika Penttilä @ 2004-03-10  5:06 UTC (permalink / raw)
  To: linux-hotplug



Greg KH wrote:

>On Tue, Mar 09, 2004 at 06:10:35PM +0100, Luca T. wrote:
>  
>
>>Hello,
>>i would like to understand how hotplugging works, i did some experiments 
>>but without success.
>>If i did understand well, when i connect an usb-disk the script 
>>/etc/hotplug/usb/usb-storage should be fired... but this doesn't seem to 
>>happen.
>>    
>>
>
>What kernel are you using?
>
>  
>
>>I put a line inside it ( echo "test" >/tmp/test ) but the file is never 
>>created when i plug or unplug my usb-disk.
>>Why?
>>    
>>
>
>On 2.4 that script would only be run when the driver is first loaded.
>When the device is removed, the driver is never unloaded.
>
>thanks,
>
>greg k-h
>  
>
At least with recent hotplug packages user mode drivers are loaded even 
if kernel module is loaded or not, in 2.4 and 2.6.

--Mika




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-03-10  5:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-09 17:10 usb-storage Luca T.
2004-03-09 17:21 ` usb-storage Sabharwal, Atul
2004-03-09 19:09 ` usb-storage Luca T.
2004-03-09 19:46 ` usb-storage Greg KH
2004-03-09 22:12 ` usb-storage Luca T.
2004-03-09 22:40 ` usb-storage Greg KH
2004-03-09 22:49 ` usb-storage Luca T.
2004-03-09 22:59 ` usb-storage Greg KH
2004-03-10  5:06 ` usb-storage Mika Penttilä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).