This problem is completely solved with storage devices and their partitions by having multiple names for each device or partition, so they can be referred to by hardware interface id, by uuid, etc.
$ ls -d /dev/disk/*
/dev/disk/by-id /dev/disk/by-path /dev/disk/by-uuid
$ ls -d /dev/[hs]d*
/dev/sda /dev/sda1 /dev/sda2 /dev/sda5 /dev/sdb
The only reason the same proper solution does not work for network devices is that their namespace lives outside the filesystem. So the *right* fix for the problem is to put their namespace back inside the filesystem, where it belongs. The hack under discussion above makes some things easier and others harder: it cannot fully solve the problem.
Domsch: Consistent Network Device Naming coming to Fedora 15
Posted Jan 27, 2011 16:58 UTC (Thu) by butlerm (subscriber, #13312)
[Link]
/dev/disk/by-path is useful, but surely there is something deterministic that could be assigned that is simpler than "/dev/disk/pci-0000:00:1f.2-scsi-0:0:0:0" for a simple onboard SATA or SCSI disk.
Thirty years ago, on an Apple II one could issue commands like "CATALOG,S6,D2" and it would list the contents of the second drive connected to the sixth slot. Would it be so unreasonable to expect the OS to use information from the BIOS to determine that "this PCI / bus id connects to the first onboard disk interface, the second onboard disk interface", and so on, and allocate simple static names accordingly?
SMBIOS provides this information for onboard disk controllers and other devices in addition to Ethernet interfaces, I understand.
Domsch: Consistent Network Device Naming coming to Fedora 15
Posted Jan 28, 2011 22:28 UTC (Fri) by bpearlmutter (subscriber, #14693)
[Link]
That isn't really a kernel issue, or anything deep. You can make more symbolic links, named as you please, with appropriate rules in the hal configuration files. In fact, names like you suggest would be a great addition, maybe /dev/disk/by-bus/pci/* and /dev/disk/by-bus/usb/* and such. Not sure if they'd see much use by scripts or automatic mechanisms, but they would certainly be useful to ls -lR and see what's what.