1 |
On Saturday 16 January 2010 20:28:53 Jarry wrote: |
2 |
> >> Now I installed one more sata-disk, attached to "sata4" |
3 |
> >> position on mobo. But this changed the way how other |
4 |
> >> disks are detected: |
5 |
> >> |
6 |
> >> Mobo: drive: system: |
7 |
> >> sata1 160GB /dev/sdb |
8 |
> >> sata2 160GB /dev/sdc |
9 |
> >> sata3 dvdrw (not_detected) |
10 |
> >> sata4 500GB /dev/sda |
11 |
> |
12 |
> ... |
13 |
> |
14 |
> > I don't know if that is normal behavior or a bug, |
15 |
> |
16 |
> In between I got a reply from other mailing list saying |
17 |
> "it is not a bug, it is a feature!". And the reason for |
18 |
> this feature is udev - it creates dev-files dynamically |
19 |
> and sata port-numbers do not play any role for order |
20 |
> in which hard-drives are detected and dev-file created. |
21 |
> Maybe some udev-expert here could explain in which |
22 |
> order udev writes device-files for hard-disks (maybe |
23 |
> serial number, or vendor name?)... |
24 |
> |
25 |
|
26 |
Generally it's the order they are found in. |
27 |
|
28 |
udev gives you the ability to dynamically create only the nodes you need |
29 |
without having to worry if you've left something out of MAKEDEV. To do this, |
30 |
the developer had to sacrifice your ability to predict what a device name will |
31 |
be. |
32 |
|
33 |
You actually don't care what the name of a thing in /dev/ is, it really |
34 |
doesn't matter. The kernel knows what they are by looking at the major and |
35 |
minor numbers and the name only exists while that instance of udev is running. |
36 |
To work with the device (eg mounting it), you should use some other |
37 |
characteristic of the device, like it's serial number or volume label. Which |
38 |
means things like /dev/sda3 should not appear in fstab. |
39 |
|
40 |
View it this way: |
41 |
|
42 |
You have a disk volume with a filesystem on it that you called "HOME", and you |
43 |
want to mount that filesystem to /home. You should just do that directly. |
44 |
|
45 |
The other way involves a completely useless extra step that the user doe snot |
46 |
even need to know about: You have a filesystem on it called "HOME", so you |
47 |
looked it up in some arcane table and found that it has the arbitrary name of |
48 |
/dev/sda3, so you mount /dev/sda3 to /home. Hmmmmmm, what's this extra step of |
49 |
looking something up somewhere? It serves no useful purpose, gives no extra |
50 |
information and is completely redundant. |
51 |
|
52 |
If all you are doing is making filesystems available for use, and you find you |
53 |
are getting involved with device names, then you are doing something contrary |
54 |
to current kernel/udev/userspace practice. |
55 |
|
56 |
|
57 |
|
58 |
|
59 |
-- |
60 |
alan dot mckinnon at gmail dot com |