Subject: Re: Config ...
To: Todd Vierling <tv@pobox.com>
From: Stefan Grefen <grefen@hprc.tandem.com>
List: port-i386
Date: 08/22/1998 09:12:32
In message <Pine.NEB.4.02.9808211916030.237-100000@duhnet.net>  Todd Vierling wrote:
> On Fri, 21 Aug 1998, C Kane wrote:
> 
> : Something I've long disliked about NetBSD is the numbering
> : scheme used to name disks (and tapes and many other peripherals).
> : 
> : Why is the first disk called "sd0" and the second disk "sd1"
> : regardless of SCSI ID or controller?  I think even a new naive 
> : user would understand that a disk on SCSI ID 4 is called sd4.
> 
> Because I have three SCSI controllers in one machine for speed, and don't
> want to call ID 0, LUN 0 on the third controller "sd256"...?

The name in the filesystem is just one thing, how major/minor numbers 
are the real thing.

Why not having a minor number 0xCCDDP (controler/bus device/unit partition) ? 
You can name that sd2 or dsk/sd03000 and the minor number would still be
0x03000 for partition 0.
Of course this would require changes to the sd driver to go from an simple
arrary in cd_devs to a hash structure (unless you want less than 1% of
tha array to be used. It is alreasy a pointer to the structures you 
can simply change SDUNIT() to return an index in that array using a 
seprate hash for mapping.
Technicaly this is easy.
I would prefer an indentification based on a label on the disk, that way
if you move a disk around it is still indenfied correctly.
I know at least one commercial OS that does it, thats the old convex
SPP-UX (now killed by HP) where you move disks between differen busses
and even the stripes stayed intact. I love that feature.

With a dynamic /dev/dsk or so you can all those features ... at least
for the uservisible namespace.

> 
> The auto-detection is much more compact in a system which has static /dev
> nodes.  If, of course, we had a _dynamic_ /dev system, a more specific
> device naming scheme could be used.  But putting a bunch of controller-based
> (and remember, LUN-based) nodes on a disk when you already have 8 per for
> partitions is just way too much.
> 
> 2 controllers * 16 IDs * 8 LUNs * 8 partitions * 2 types of nodes [chr&blk]
>  = 32768 nodes just to hold two SCSI controllers.

If you use a hash table its just wasted minor number space, as with the
current scheme (you don't have 30 disks with 8 LUNS). 

Using this scheme for minor numbers you can use a dynamic /dev/ to rename
the drives to what ever you like.

Stefan
> 
> -- 
> -- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)
> 

--
Stefan Grefen                                Tandem Computers Europe Inc.
grefen@hprc.tandem.com                       High Performance Research Center
 --- Hacking's just another word for nothing left to kludge. ---