Re: re-detect SCSi bus?

James Mastros (shalon@interlock.dfw.ibm.com)
Wed, 18 Mar 1998 17:14:17 -0600


Date: Wed, 18 Mar 1998 12:59:26 -0500 (EST)
From: Doug Crompton <wa3dsp@marconi.crompton.com>
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Orcpt: rfc822;linux-kernel@vger.rutgers.edu
Sender: owner-linux-kernel@vger.rutgers.edu
Precedence: bulk
X-Loop: majordomo@vger.rutgers.edu

On Wed, 18 Mar 1998, Lech Szychowski wrote:

> > SCSI module is just not an option. If anyone knows where to grab docs on
> > doing a rescan (even a hacked one) I'd appreciate it (I'm hoping to get as
>
> Well, feel free to correct me if I'm wrong, but drivers/scsi/scsi.c
> already specifies/supports such functionality:
>
> /*
> * Usage: echo "scsi add-single-device 0 1 2 3" >/proc/scsi/scsi
> * with "0 1 2 3" replaced by your "Host Channel Id Lun".
> * Consider this feature BETA.
> * CAUTION: This is not for hotplugging your peripherals. As
> * SCSI was not designed for this you could damage your
> * hardware !

YES YES - I know all this I have been following it here. We know we can
use /proc to diddle individual SCSI ID's. My point was that this was a
rather (possibly) dangerous way to do it. I was thinking of something
more removed from the inards for a less? guru operator. I don't wana know
boards,channels,id's - I wanna turn on a device and say find it.

So how do we define "hot plugging" and is SCSI really that unforgiving?
I suspect that one would should be more careful on disk I/O but there are
a lot of other devices on SCSI that would be less of a concern. As I said
before I routinely use a removeable SCSI HD for backup. I turn the key
on, mount it, backup, umount, turn the key off. It then can, if you wish,
be removed - BUT if it is not turned on at boot - it is not recognized by
mount - and yes you could use /proc/scsi/scsi xxxx to find it but I
think there should be a "higher level" way to do this for SCSI devices.

Hmm. I'm not *that* familiar with SCSI, but I would assume that that
add-single-device would fail if there was no device attached, yes? How
hard would it be to write a script that simply checked to see how many
hosts you had, how many channels you had, and what devices were
already know. Then it would simply run down the list of "Host Channel
Id" skipping any which were already known. You also could give the
script an Id to check all LUNs on.

This is of course assuming that there are no bad side effects to
trying to add a nonexistant SCSI device; I'll take a look when I get
home tonight and have source.

On a similar note, is there a 'remove-single-device command'? How hard
would it be to add?

Shalon Wood
dstar@pele.ml.org
shalon@interlock.dfw.ibm.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu