From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Mansfield Date: Fri, 12 Mar 2004 19:03:35 +0000 Subject: Re: Manual udev invocation & via hotplug method gives different results Message-Id: <20040312110335.A8449@beaverton.ibm.com> List-Id: References: <2F75A5CCEF1E6A4C8CA2E75CF7F529E9021E2549@orsmsx409.jf.intel.com> In-Reply-To: <2F75A5CCEF1E6A4C8CA2E75CF7F529E9021E2549@orsmsx409.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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_id70&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