Re: udev device naming policy concerns
Roger Leigh <roger@whinlatter.uklinux.net> writes:
> The current single directory with a bazillion device nodes in it
> doesn't scale well. Not only is it difficult to find the nodes
> actually available on your system, it also has the potential to hurt
> performance. For example, an "ls /dev" on my system shows 1439 device
> nodes, of which perhaps 10% are actually available and 5% have
> actually ever been used. When any program scans /dev, that's 1400
> dentries created for no good reason, and I haven't got the full set of
> device nodes.
With udev you would only get those 10% actually available. No hda60 if
you only have 5 partitions on hda. But still the /dev would be pages
full on reasonable systems.
> I do vastly prefer the devfs-style names, vc/1, tts/3 etc., and I use
> these without devfs. The only aspects of devfs I disliked were:
> /dev/cdroms }
> /dev/discs } too unpredictable which device gets which number
Just like /dev/scd0 or /dev/sda, /dev/dsp. Its just hdXY that
specifies a specific hardware port and even that chages if you have
two ide controlers and the order the modules/drivers get loaded
changes. Pretty much everything else is very dynamic already.
> /dev/ide0/lun0/.... far too unweildy when /dev/hda/3 would do as well
/dev/ide/host0/bus0/target0/lun0/disc
/dev/scsi/host0/bus0/target1/lun0/disc
Some subdirs could be omitted. Like lun0 on ide since ide has no luns.
But having a tree structure following the hardware starting with the
type, the controler, the connector, the id of the drive and last the
lun is a very clean way to address all hardware. Many scsi cd changers
use the lun to select the CD to use for example. For systems with a
lot of hardware thats very organised.
For systems with less hardware the /dev/discs/ links should be unique
enough to be usefull. E.g. on my laptop I use /dev/discs since it only
has one harddisk. No chance of confusion there. Same for /dev/cdrom,
all my systems have 0 or 1 cdrom drive.
What bothers me is that the /dev/discs/ links get resolved and show up
as the long names they point to. That looks ugly in the mount or df
output and is a bit confusing when comparing the fstab to mount/df
output. Maybe instead of linking real devices should be setup. That
way whatever device is used will show up in programs output.
MfG
Goswin
Reply to: