* Re: Manual udev invocation & via hotplug method gives different results
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
@ 2004-03-12 1:42 ` Greg KH
2004-03-12 1:51 ` Sabharwal, Atul
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2004-03-12 1:42 UTC (permalink / raw)
To: linux-hotplug
On Thu, Mar 11, 2004 at 05:26:29PM -0800, Sabharwal, Atul wrote:
> Is there a difference between invoking udev manually from the command
> line versus
> invoking it from a hotplug event ? I expect the same result but have a
> case where
> the results are different :
Have you tried using udevtest to see if that gives you the same result?
I am not sure what the /proc/scsi... echoing really does with regards to
creating hotplug events. Are you sure it is identical?
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] 8+ messages in thread* RE: Manual udev invocation & via hotplug method gives different results
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
2004-03-12 1:42 ` Greg KH
@ 2004-03-12 1:51 ` Sabharwal, Atul
2004-03-12 18:44 ` Sabharwal, Atul
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Sabharwal, Atul @ 2004-03-12 1:51 UTC (permalink / raw)
To: linux-hotplug
> Is there a difference between invoking udev manually from the command
> line versus
> invoking it from a hotplug event ? I expect the same result but have a
> case where
> the results are different :
>>Have you tried using udevtest to see if that gives you the same
result?
How should I use udevtest ? Should I put it in place of udev binary ?
>>I am not sure what the /proc/scsi... echoing really does with regards
to
>>creating hotplug events. Are you sure it is identical?
I think it's a software method for simulating SCSI/fiber channel disk
insertion/deletion. It removes the device from /proc/scsi/scsi table.
It also deletes the device entry from sysfs. Which causes udev to
trigger.
In 2.6.2, the insertion/removal was not 100% reliable as command would
Fail or ignore user request. Now, with 2.6.4 kernel, the command is
Reliable but I get three new entries when I expect one!!
--
Atul
-------------------------------------------------------
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] 8+ messages in thread* RE: Manual udev invocation & via hotplug method gives different results
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
2004-03-12 1:42 ` Greg KH
2004-03-12 1:51 ` Sabharwal, Atul
@ 2004-03-12 18:44 ` Sabharwal, Atul
2004-03-12 18:54 ` Manual udev invocation & via hotplug method gives different Kay Sievers
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Sabharwal, Atul @ 2004-03-12 18:44 UTC (permalink / raw)
To: linux-hotplug
>>Have you tried using udevtest to see if that gives you the same
result?
I tried udevtest and it gives same result as udev. The scsi
commands give three device entries.
--
Atul
-------------------------------------------------------
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=ick
_______________________________________________
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] 8+ messages in thread* RE: Manual udev invocation & via hotplug method gives different
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
` (2 preceding siblings ...)
2004-03-12 18:44 ` Sabharwal, Atul
@ 2004-03-12 18:54 ` Kay Sievers
2004-03-12 19:03 ` Manual udev invocation & via hotplug method gives different results Patrick Mansfield
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Kay Sievers @ 2004-03-12 18:54 UTC (permalink / raw)
To: linux-hotplug
On Fri, 2004-03-12 at 19:44, Sabharwal, Atul wrote:
> >>Have you tried using udevtest to see if that gives you the same
> result?
>
> I tried udevtest and it gives same result as udev. The scsi
> commands give three device entries.
Seems that the kernel emits 3 hotplug events for this device.
If you compile udev with 'make DEBUG=true' you can follow the invocation
of udevsend in the syslog.
Kay
-------------------------------------------------------
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] 8+ messages in thread* Re: Manual udev invocation & via hotplug method gives different results
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
` (3 preceding siblings ...)
2004-03-12 18:54 ` Manual udev invocation & via hotplug method gives different Kay Sievers
@ 2004-03-12 19:03 ` Patrick Mansfield
2004-03-12 19:43 ` Sabharwal, Atul
2004-03-12 23:50 ` Sabharwal, Atul
6 siblings, 0 replies; 8+ messages in thread
From: Patrick Mansfield @ 2004-03-12 19:03 UTC (permalink / raw)
To: linux-hotplug
On Fri, Mar 12, 2004 at 10:44:35AM -0800, Sabharwal, Atul wrote:
> >>Have you tried using udevtest to see if that gives you the same
> result?
>
> I tried udevtest and it gives same result as udev. The scsi
> commands give three device entries.
Getting an sda, sda1, and sg1 is the expected behaviour. sg is the "scsi
generic" or scsi pass through interface and ... sda1 a partition of sda.
If you were getting multiple entries in /sys/bus/scsi/devices for the one
command, that would be bad.
The addition and removal of a scsi device using /proc/scsi/scsi (or sysfs
interfaces for a single LUN) is the equivalent of a hotplug removal and
addition of a single scsi device (LUN or disk, not a host and not a scsi
target). These are vary useful for testing udev or other hotplug code,
they can be used with USB mass storage devies and scsi_debug disks.
Also, you can use the sysfs remove/scan interfaces. The /proc ones will go
away someday. The scan interface is nicer for multi-LUN devices as it will
use the REPORT LUNS to scan, and can scan an entire bus, target or just a
single LUN.
To remove a LUN use:
echo anythinghere > /sys/bus/scsi/devices/H:C:T:L/delete
To scan, general syntax is:
echo "C T L" > /sys/class/scsi_host/hostH/scan
Where H C T L are respectively the host number, channel, target id, and
lun.
So remove a single LUN at 1 0 0 0 via:
echo anythinghere > /sys/bus/scsi/devices/1:0:0:0/delete
The scan can be wildcarded via '-'.
To scan all of host1:
echo "- - -" > /sys/class/scsi_host/host1/scan
Scan a single channel/bus 0:
echo "0 - -" > /sys/class/scsi_host/host1/scan
Scan target 0:
echo "0 0 -" > /sys/class/scsi_host/host1/scan
Scan a single LUN:
echo "0 0 0" > /sys/class/scsi_host/host1/scan
-- Patrick Mansfield
-------------------------------------------------------
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] 8+ messages in thread* RE: Manual udev invocation & via hotplug method gives different results
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
` (4 preceding siblings ...)
2004-03-12 19:03 ` Manual udev invocation & via hotplug method gives different results Patrick Mansfield
@ 2004-03-12 19:43 ` Sabharwal, Atul
2004-03-12 23:50 ` Sabharwal, Atul
6 siblings, 0 replies; 8+ messages in thread
From: Sabharwal, Atul @ 2004-03-12 19:43 UTC (permalink / raw)
To: linux-hotplug
>Getting an sda, sda1, and sg1 is the expected behaviour. sg is the
"scsi
>generic" or scsi pass through interface and ... sda1 a partition of
sda.
>If you were getting multiple entries in /sys/bus/scsi/devices for the
one
>command, that would be bad.
I was expecting descriptive names. Not sda. If udevtest can create
descipive
Names, why not the hotplug sequence via udevsend. Is it because the
rules are
Not working with hotplug events ?
>The addition and removal of a scsi device using /proc/scsi/scsi (or
sysfs
>interfaces for a single LUN) is the equivalent of a hotplug removal and
>addition of a single scsi device (LUN or disk, not a host and not a
scsi
>target). These are vary useful for testing udev or other hotplug code,
>they can be used with USB mass storage devies and scsi_debug disks.
>Also, you can use the sysfs remove/scan interfaces. The /proc ones will
go
>away someday. The scan interface is nicer for multi-LUN devices as it
will
>use the REPORT LUNS to scan, and can scan an entire bus, target or just
a
>single LUN.
>To remove a LUN use:
> echo anythinghere > /sys/bus/scsi/devices/H:C:T:L/delete
>To scan, general syntax is:
> echo "C T L" > /sys/class/scsi_host/hostH/scan
>Where H C T L are respectively the host number, channel, target id, and
>lun.
>So remove a single LUN at 1 0 0 0 via:
> echo anythinghere > /sys/bus/scsi/devices/1:0:0:0/delete
>The scan can be wildcarded via '-'.
>To scan all of host1:
> echo "- - -" > /sys/class/scsi_host/host1/scan
>Scan a single channel/bus 0:
> echo "0 - -" > /sys/class/scsi_host/host1/scan
>Scan target 0:
> echo "0 0 -" > /sys/class/scsi_host/host1/scan
>Scan a single LUN:
> echo "0 0 0" > /sys/class/scsi_host/host1/scan
Thanks a bunch on the SCSI hotplug commands with sysfs. I had been
googling and
could not find any information.
Thanks,
Atul
-------------------------------------------------------
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] 8+ messages in thread* RE: Manual udev invocation & via hotplug method gives different results
2004-03-12 1:26 Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
` (5 preceding siblings ...)
2004-03-12 19:43 ` Sabharwal, Atul
@ 2004-03-12 23:50 ` Sabharwal, Atul
6 siblings, 0 replies; 8+ messages in thread
From: Sabharwal, Atul @ 2004-03-12 23:50 UTC (permalink / raw)
To: linux-hotplug
Thanks. Your e-mail has answered my question. Also, the rule I had
written
was failing, hence, I was getting sda instead of descriptive names.
My mistake!!
Regards,
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
Sabharwal, Atul
Sent: Friday, March 12, 2004 11:44 AM
To: Patrick Mansfield
Cc: linux-hotplug-devel@lists.sourceforge.net
Subject: RE: Manual udev invocation & via hotplug method gives different
results
>Getting an sda, sda1, and sg1 is the expected behaviour. sg is the
"scsi
>generic" or scsi pass through interface and ... sda1 a partition of
sda.
>If you were getting multiple entries in /sys/bus/scsi/devices for the
one
>command, that would be bad.
I was expecting descriptive names. Not sda. If udevtest can create
descipive
Names, why not the hotplug sequence via udevsend. Is it because the
rules are
Not working with hotplug events ?
>The addition and removal of a scsi device using /proc/scsi/scsi (or
sysfs
>interfaces for a single LUN) is the equivalent of a hotplug removal and
>addition of a single scsi device (LUN or disk, not a host and not a
scsi
>target). These are vary useful for testing udev or other hotplug code,
>they can be used with USB mass storage devies and scsi_debug disks.
>Also, you can use the sysfs remove/scan interfaces. The /proc ones will
go
>away someday. The scan interface is nicer for multi-LUN devices as it
will
>use the REPORT LUNS to scan, and can scan an entire bus, target or just
a
>single LUN.
>To remove a LUN use:
> echo anythinghere > /sys/bus/scsi/devices/H:C:T:L/delete
>To scan, general syntax is:
> echo "C T L" > /sys/class/scsi_host/hostH/scan
>Where H C T L are respectively the host number, channel, target id, and
>lun.
>So remove a single LUN at 1 0 0 0 via:
> echo anythinghere > /sys/bus/scsi/devices/1:0:0:0/delete
>The scan can be wildcarded via '-'.
>To scan all of host1:
> echo "- - -" > /sys/class/scsi_host/host1/scan
>Scan a single channel/bus 0:
> echo "0 - -" > /sys/class/scsi_host/host1/scan
>Scan target 0:
> echo "0 0 -" > /sys/class/scsi_host/host1/scan
>Scan a single LUN:
> echo "0 0 0" > /sys/class/scsi_host/host1/scan
Thanks a bunch on the SCSI hotplug commands with sysfs. I had been
googling and
could not find any information.
Thanks,
Atul
-------------------------------------------------------
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=ick
_______________________________________________
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] 8+ messages in thread