On Saturday 16 January 2010 20:28:53 Jarry wrote:
> >> Now I installed one more sata-disk, attached to "sata4"
> >> position on mobo. But this changed the way how other
> >> disks are detected:
> >>
> >> Mobo: drive: system:
> >> sata1 160GB /dev/sdb
> >> sata2 160GB /dev/sdc
> >> sata3 dvdrw (not_detected)
> >> sata4 500GB /dev/sda
> 
> ...
> 
> > I don't know if that is normal behavior or a bug,
> 
> In between I got a reply from other mailing list saying
> "it is not a bug, it is a feature!". And the reason for
> this feature is udev - it creates dev-files dynamically
> and sata port-numbers do not play any role for order
> in which hard-drives are detected and dev-file created.
> Maybe some udev-expert here could explain in which
> order udev writes device-files for hard-disks (maybe
> serial number, or vendor name?)...
> 

Generally it's the order they are found in.

udev gives you the ability to dynamically create only the nodes you need 
without having to worry if you've left something out of MAKEDEV. To do this, 
the developer had to sacrifice your ability to predict what a device name will 
be.

You actually don't care what the name of a thing in /dev/ is, it really 
doesn't matter. The kernel knows what they are by looking at the major and 
minor numbers and the name only exists while that instance of udev is running. 
To work with the device (eg mounting it), you should use some other 
characteristic of the device, like it's serial number or volume label. Which 
means things like /dev/sda3 should not appear in fstab.

View it this way:

You have a disk volume with a filesystem on it that you called "HOME", and you 
want to mount that filesystem to /home. You should just do that directly.

The other way involves a completely useless extra step that the user doe snot 
even need to know about: You have a filesystem on it called "HOME", so you 
looked it up in some arcane table and found that it has the arbitrary name of 
/dev/sda3, so you mount /dev/sda3 to /home. Hmmmmmm, what's this extra step of 
looking something up somewhere? It serves no useful purpose, gives no extra 
information and is completely redundant.

If all you are doing is making filesystems available for use, and you find you 
are getting involved with device names, then you are doing something contrary 
to current kernel/udev/userspace practice.




-- 
alan dot mckinnon at gmail dot com

Reply via email to