Subject: Re: Config ...
To: None <grefen@hprc.tandem.com>
From: Todd Whitesel <toddpw@best.com>
List: tech-kern
Date: 08/20/1998 19:58:26
>I hate rebooting my machine to turn on/off a tape or move it to another machine
>There is only one thing missing in NETBsd, a command to start/stop a scsi-bus,
>and you could revommend a save method for switching devices online.
>(eg. Unixware 7 has this now)

When I was using/adminning SunOS at my last job, tape drives and CD-ROMs
were regularly moved around without rebooting machines:

	umount (does this guarantee a sync?)
	stop-A (suspend the kernel and enter debug firmware with ints masked)
	unplug tape/cdrom and fix terminator
	'go' (unsuspend the kernel)

... and a similar reverse procedure for reconnecting things. I found that
this worked quite well, and never once observed any fried hardware.

The same technique worked with Solaris2 but could be foiled by "boot -r"
which would remove the unused device nodes from /dev.

The theory here is that SCSI bus interface hardware is hi-impedance when
the bus is idle, and diode-protected so that a powered-down device does
not interfere with the bus it is on. As long as the bus is kept quiescent
while things are being connected and disconnected, there's no danger of
damaging anything.

The only tricky part is making sure your kernel drivers don't _panic_ just
because a device that used to be there is no longer responding. It should
just time out and print nasty messages to the syslog.  Later when the device
is reconnected, subsequent attempts to use that device should succeed.

As I currently have a second SCSI port out the back of my main i386 box
just to provide a dedicated/isolated port for my CD-R and Scanner (both
of which are terminated due to available cabling and thus cannot both
be connected at the same time, presently), it would be nice to have a
reliable procedure for 'lukewarm-swapping' of SCSI devices.

Todd Whitesel
toddpw @ best.com