Subject: Re: nore on disk stats
To: None <perry@piermont.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-install
Date: 11/10/1995 12:18:29
On Fri, 10 Nov 1995 14:35:31 -0500 
 "Perry E. Metzger" <perry@piermont.com> wrote:

 > Doesn't actually work with all devices.
 > 
 > Take the NCR driver, for instance:
 > 
 >    ncr0 targ 0 lun 0: <QUANTUM, XP34301, 1051> SCSI2 0/direct fixed
 >    sd0 at scsibus0sd0(ncr0:0:0): FAST SCSI-2 100ns (10 Mb/sec) offset 8.
 >    : 4106MB, 4076 cyl, 20 head, 103 sec, 512 bytes/sec

This is, IMHO, a _bug_ in the NCR driver.  I've mentioned the fact that 
the NCR driver prints stuff at the wrong times before to a few people, 
but no one seems to take any action on it.  I have an NCR driver in my 
private tree that doesn't screw up that formatting.

But, you could always just take the cyl part of that grep.  I just tried 
that with the case you provided, and it works fine.

 > Incidently, grabbing the <QUANTUM, XP34301, 1051> in a standard way
 > would be neat, too, because then install could present the user with a
 > list like:

Actually, this is extremely trivial to do in a small C program.  Now, if 
other work-related projects would stop bumping my SCSI page lower down 
the priority list...

 >    Install on which of the following?
 > 
 >    1) sd0: [QUANTUM, XP34301, 1051]   4106MB
 >    2) sd2: [BAMBLEWEENIE 6000]        9012MB

 > This is also insufficient. I'd like to be able to pull a bunch of
 > information out like hardware address and other stuff. Again, its all
 > hard when you don't really have standardization on the printout.

I personally don't see anything wrong with displaying the entire line, 
but that's me.  Of course, if you wrote it all in C, you could easily get 
that kind of information.  See the "perfect world" comment at the top of 
most install.sh's.

 > Also, it would be nice if disk drives and network interfaces gave you
 > enough information about themselves that you didn't need to hard code
 > what the device names were -- among other things, that could help in
 > trying to make the install stuff machine independent and more
 > maintainable.

Again, if written in C, one could use libkvm to traverse `alldevs', get 
the device class (DV_DISK, DV_IFNET, etc.), and print out the external 
name if it's the kind of device you're looking for.

 > I'd rather see things standardize sufficiently that you don't need
 > much in the way of machine dependant stuff at all...

Unfortunately, that's not all that easy.  With SCSI, it's a little 
easier; there's a standard for interfacing with the devices.  But when 
you're talking about a network interface chip which might be in N 
different machines with M different busses, interrupt schemes, etc., you 
just might want/have to print out different information at boot time.

--------------------------------------------------------------------------
Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939