Subject: Re: Config ...
To: None <tech-kern@netbsd.org>
From: David Seifert <seifert@sequent.com>
List: tech-kern
Date: 08/20/1998 21:50:57
> >I hate rebooting my machine to turn on/off a tape or move it to another machine

Online insertion and removal is essential for the big-time.
And not just for SCSI drives...

> >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)

Given devices that do not glitch or reset the bus when powered up
(some guarentee a clean power-up, some older drives definitely
hose the bus) you don't need to stop the bus, just power down the device,
unplug it, plug in the replacement, power up the replacement.

> 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.

This might work for a personal workstation, it will never fly for
mission critical machines.

> 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.

Or hang due to never receiving an interrupt they were expecting.

> 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.

I assume your problem is that you can't talk to devices which weren't
there at boot time?  Seems to me the answer is to use physical address
naming (e.g. scsibus 0, ID 2, LUN 0), and if you try to open(2) a device
that isn't configured, probe for it at open time.   I know a lot of people
hate physical addressing, but as far as I can tell it is the only method
that really works, for this and other reasons.  (And some of us like it!)

> Preserving TCP connections would be very cool, but you should _block_ user
> processes that attempt to call the device entry points, not return errors.

Yuck!

> Either that or give me hard,intr and soft options for these devices. This
> exact issue comes up with NFS mounts all the time.

Better.

> I like this. For a while I have wanted to figure out how I could burn a
> minimal kernel into the motherboard flash (kill all BIOS's!!)

None of my computers have a BIOS,  *grin*

> I strongly recommend deciding what you want to do about device naming
> before embarking on dynamic configuration.

Yes.

>  It's really annoying when sd3a
> which has your root partition on it suddenly changes and becomes sd2a
> because one of the other disks did not come up.

It is more than annoying, it is dangerous!

-Dave