All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Mansfield <patmans@us.ibm.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Manual udev invocation & via hotplug method gives different results
Date: Fri, 12 Mar 2004 19:03:35 +0000	[thread overview]
Message-ID: <20040312110335.A8449@beaverton.ibm.com> (raw)
In-Reply-To: <2F75A5CCEF1E6A4C8CA2E75CF7F529E9021E2549@orsmsx409.jf.intel.com>

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

  parent reply	other threads:[~2004-03-12 19:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2004-03-12 19:03 ` Patrick Mansfield [this message]
2004-03-12 19:43 ` Manual udev invocation & via hotplug method gives different results Sabharwal, Atul
2004-03-12 23:50 ` Sabharwal, Atul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040312110335.A8449@beaverton.ibm.com \
    --to=patmans@us.ibm.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.