It would help if you started by showing where your disk would be in the
device tree. Then I can tell you what (more or less) you need in your
config file.
USB, or whatever else, is no magic. You can specify explicitly where
your disk is, and have it show up with a specific device number even
with other devices attached anywhere.
I seem to remember that way back there was even a tool (in pkgsrc?)
which extracted your current device setup, and created a config file
from that, so that you would always get the same enumeration, no matter
what else showed up on the machine.
The point is, the config file totally, and exactly describes your
hardware setup. Your suggestion would simply mean that this information
would be duplicated in the file system.
The config file have the additional "feature" of actually making the
device appear with the same name, even if you move it around, by just
changing the config file. Everything else in the system will not have to
be told after that. And the names exposed, and referred to, are simple
and short, even though you do have the full tree described in the config
file.
Someone else mentioned that the problem have grown for the simple reason
that hardware configurations change much more often now than in the
past. I would agree with that. However, for vital pieces of the
hardware, the setup normally don't change that much (such as the disks
normally used by the system).
So, the device configuration and enumeration is only random so far as
that if you tell the system that it is okay to give a device a random
number, it will actually possibly do that.
Otherwise it is totally predictable.
If you, on the other hand, do move your disk around (be that by using
USB and different ports and hubs, or different controllers), neither the
old config, nor your new solution will help. The disk will change
identity (or path) (well, with the old config, it might actually keep
it's identity, but that's a chancy proposition at best). This is why a
way to refer to disks by some other property would be nice (such as disk
labels).
(DEC actually solved this a long time ago, by letting disks have
identities, which were not in any way related to anything else than the
disk, and that was the unit numbers on MSCP disks, which you preferrably
kept unique for the whole system, but as with many other nice things, it
fell out of fashion with revolution of PC commodity hardware, which have
a foresight shorter than my nose.)
Johnny
Masao Uebayashi wrote: