Re: SCSI device numbering

Albert Cahalan (albert@ccs.neu.edu)
Wed, 3 Jul 1996 04:33:14 -0400 (EDT)


From: "Leonard N. Zubkoff" <lnz@dandelion.com>
>>From: Albert Cahalan <albert@ccs.neu.edu>
>>> (Bus Type = PCI, bus, device, function, channel, target, lun, partition)
>>>

>>> I believe the above 8-tuple is sufficient as a minor number
>>> for PCI for any SCSI device accessible via a PCI SCSI host
>>> adapter. None of these elements are dependent on the number
>>> or type of installed PCI host adapters. The bus and device
>>> are a property of the physical slot in which the host adapter
>>> is installed, together with the function and channel which are
>>> properties of the host adapter implementation.
>>
>> So when I change my SCSI card, the root filesystem remains read-only
>> and /usr does not get mounted because they now have new device names.
>
> Possible, but very unlikely. The only parameters that are host
> adapter dependent are function and channel. The function will
> be 0 unless there are multiple functions implemented by the one
> host adapter. The channel also need not change unless you replace
> a multi-channel card with one that has fewer channels, or re-cable
> differently.
>
> The 8-tuple above should be invariant under a large variety of
> SCSI host adapter replacements.

You assume I put the new adapter in the same slot, or at the same
ISA IO address. It is quite likely I'd have to move cards around
to make it fit. Some people (not me) would then _really_ lose while
the PnP BIOS and Win95 argue over the new setup.

Proposal:

Partially dynamic 12-bit major number (see below...)
reserved? 4
adapter 4
bus 4
Fixed 20-bit minor number (would be slightly modified for IDE, etc.)
device 8
lun 8
partition 4

When the major number is 0, the minor number uses the old 16-bit
dynamic numbers. To reduce SCSI adapter movement, several "easy"
adapter types get preassigned numbers as follows:

0 16-bit dev_t compatibility (aliases)
1 adapter with root filesystem (an alias)
2 nfs, proc, ramdisk (each is a "bus" with 2**20 minors)
3 floppy
4 IDE
? several reserved numbers
n all others, starting with the first SCSI adapter

I hope this makes almost everybody happy :-)

We get enough device numbers for everything, they are as static
as the hardware permits, and it all looks great in a 12:20 dev_t.
To keep things truly fixed on systems with 3+ disk adapters,
a syscall could let a user program swap major numbers before most
filesystems are mounted. The devfs issue is somewhat unrelated - it
would work with any size static or dynamic dev_t.