Subject: Re: Dynamic SCSI ids (was: A possible way of handling...)
To: Allen Briggs <briggs@puma.macbsd.com>
From: Johan Danielsson <joda@pdc.kth.se>
List: tech-kern
Date: 03/31/1997 00:11:17
Allen Briggs <briggs@puma.macbsd.com> writes:

> So how are disks mapped to specific devices?

Fairly straightforward:

rz0 == scsi id 0 on scsi bus 0
rz1 == scsi id 1 on scsi bus 0
rz8 == scsi id 0 on scsi bus 1
rzb0 == scsi id 0 lun 1 on scsi bus 0

The minor device number has the following layout:

        ----------------------------------------------------------
 Bits: | 19      14 | 13         10 | 9         6 | 5           0 |
        ----------------------------------------------------------
       |  Bus no.   |  Target ID    |      LUN    | Partition no. |
        ----------------------------------------------------------

> I would still like to see a proposed plan, in some detail, of how
> you think it should work.

Ah, details. :-)

If that we had a way to uniquely define scsi-buses, then the naming
would get quite easy. You can choose to call the disks c0t1d2, or
dks0d2l1, or rzc1, or whatever you like.

So, the problem boils down to telling different busses apart. Either
you don't, and assume that people don't move scsi-adapters around as
much as they do disks. This would give you a system that is somewhat
better that what we have today.

Or you need to have some way of permanently tagging busses, and
keeping some kind of database. This doesn't sound like something you
really want to do.

It would probably be easier to tag disks rather than busses (you for
instance have an obvious place to store the information). And then you
are back you logical disk names.  You could then mount /dev/usr rather
than /dev/sd0e.

> Give us a proposed better way of doing things.  I'm not asking for
> code--just a detailed description...

As it turns out this wasn't a `detailed proposal', but rather an
explanation of how it works in most other OS:es. I personally think it
is more clear and less error prone.

> It will also require re-educating a lot of people if we do change
> it, so it can't be changed without real, tangible, defensable
> reason.

Nothing would, of course, stop anyone from having both sd0 and c0t0d0
device nodes.

/Johan