Re: SCSI disk devices, even crazier naming scheme

Andras Kadinger (bandit@freeside.elte.hu)
Tue, 06 May 1997 07:14:59 +0200


[Sorry for not replying in the original thread.]

david parsons wrote:

> It depends on what you're looking for. If you're looking for
> a naming scheme that tells you what the device is, it's
> hard to get better than a [C]ontroller[D]evice[L]un[P]artition
> system, unless you want to be verbose:
>
> /dev/scsi/controller0/disk1/lun0/partition2

To exercise this to an extreme level, Eric (or some brave soul) could
enhance scsidev to provide
rather longish and practically untypable names providing all (by some
definition of all) available
identification data of a scsi entity, and then everybody could make up
simple scripts (which we have
to do anyway in order to customize our systems) to use the magic of
filename expansion to enumerate,
retrieve and sort all the devices to their heart's content.

A (rather silly) example follows.
You could have an entry in /proc/actualscsidevices (or a corresponding
/dev variant) with the name
aic7xxx.io6500.channel0.id0.lun0.parition0.type-directaccess.serno-XXXXXXXXXX.vendor-IOMEGA.model-ZIP
100
[sorry for that] (substitute previously defined, reasonable, ordered [by
meaning or alphabetically] field
sets and delimiters).

After landing in this situation and unless I am very silly and do not
know enough about filename expansion, and the popularity thereof [in
which case flames are welcome], from the very simplest

ln -s *model-ZIP 100* /dev/zip

or, in the case of partitions,

for count in 0 1 2 3 4 5 6 7 8 9; do ln -s *model-ZIP
100*partition-$count* /dev/zip$count; done

through the more complicated

ln -s `ls *fstype-ext2*serialno-xxxxx* | head -n 2 | tail -n 1` \
/dev/The_Second_ext2_Partition_On_The_Device_With_Serno_xxxxx

many things are possible.

It seems to be simple (well, sort of, in cinception at least),
expandable (if you add a new field, you know, where to put it, since
they are alphabetically ordered; and that's all you need in the case of
filename expansion), and rather comprehensive [well, at least in my
opinion]. It is well-parsable and not the worst
in the are of human-readability.

I read somewhere that one big advantage of unices is the extensive
recycling of ideas and concepts.

[Side note: I just realize that this is a completely userspace problem.
After all we are just naming our
special nodes in rather perverse ways. :-) Where should I [we?] go with
this?]

Andras Kadinger
bandit@freeside.elte.hu

PS: this could be expanded to include *kind-* fields with values of
storage, communication, display, etc.
PS2: but is there really a need for that?
PS3: I wonder, what could be in the Registry of some... ahh, never mind.
:-)