Spun off from a small exchange in chat.One of the primary advantages of udev is that you don't have to worry about major and minor device number exhaustion anymore. But the devices created by udev still have these numbers associated with them. How does udev cooperate with the kernel to create device files with the proper major and minor device numbers?
How does udev get device numbers for the devices it creates?
linux kernel;udev
The kernel allocates a major:minor number, either statically (in drivers that do have a static allocation and haven't run out) or dynamically (in drivers that support dynamic allocation and have used up their static allotment). This number is listed in the message that the kernel sends to udev.You can see the variables that udev sees about a device in /sys/devices//uevent. For example:$ cat /sys/devices/virtual/mem/null/uevent MAJOR=1MINOR=3DEVNAME=nullDEVMODE=0666$ cat /sys/block/sda/sda1/uevent MAJOR=8MINOR=1DEVNAME=sda1DEVTYPE=partitionThe udev rules determine the name(s) and permissions of the device files. The device number comes from the kernel (it has to, since the kernel has already taken a decision and udev's job is to ensure that applications accessing the device by name will reach the number chosen by the kernel).