Re: SCSI disk devices

Albert D. Cahalan (
Mon, 5 May 1997 16:49:06 -0400 (EDT)

> I agree this has to be done in the 2.2 time frame.
> We've been through this over and over again,
> and there probably no point in re-iterating all
> the arguments. Somebody just needs to provide a
> set of patches, and we'll see what will break.
> glibc already made a decision: dev_t is going to be 64 bits.

I guess that means POSIX goes on the scrap heap?
It is amazing how people fight over little details
for the sake of POSIX and then scrap the whole thing
for a 64-bit dev_t.

If the kernel only _used_ 32 bits the library could
toss out the extras. That would let Linux expand if
and when 64-bit dev_t becomes legal. There is not
much justification for that overhead though, since
everything fits in 32 bits anyway. Hauling 64 bits
around on a 32-bit machine is not free you know.

I would guess a 64-bit dev_t will break _lots_ of
software that wants to put dev_t in an int.

About the SCSI device naming: Why not have it both ways?
We need the old /dev/sd* devices for compatibility anyway.
The old devices can remain dynamic for small systems.
The kernel can consider those as aliases for c0d3u0s2...
There could even be a third set of aliases that is based
on disk label. Imagine links like this:

/proc/disklabels/My_Home_Disk -> /dev/disk/c0d3u0s2

Then small systems can use /dev/sda4 until the end of time,
large systems can use /dev/disk/c0d3u0s2 on new disks,
and most people can enjoy using volume labels.

For IDE, we can steal an idea from NT. Call it SCSI for
the purpose of device names. The first "SCSI" controller
is really the 4 IDE controllers. That can be extended
to all block devices. They can be assigned like this:

Old old dynamic numbers
Floppy all 4 together
IDE all 4 together
CD-ROM all the old and strange CD-ROM drivers
SCSI impossible to keep controllers in order :-(

That works great if the adapter and device are in the major number
and the minor number just has LUN and partition:

8 bus --> 256 busses (old, IDE, floppy, 1 per SCSI card...)
8 device --> 256 SCSI disks on one bus (way beyond normal)
----------------------- major/minor --------------------------
8 LUN --> 256 CD-ROMs in a disk changer
8 slice --> 256 partitions