Linux/RHEL Device Files and UDEV
Forgive me because I'm going to tell a bit of a meandering story in order to give background for a few general questions. So I am working with a Oracle DBA to set up some RAC servers with ASM. Previous to RHEL7 they had been using the Oracle-provided ASMLib utilities/libraries to configure ASM devices with persistent naming. They asked me about using UDEV as they had seen it mentioned in several documents. I had never given much though to UDEV or device files because I've generally been working in pretty static virtual environments where it wasn't necessary. Anyhow, most of the information I found related to UDEV and ASM was limited to RHEL6 and earlier. After some experimentation I found that UDEV in RHEL7 only allows one to create soft links to existing device files rather than creating or renaming device files. The issue here was that the Oracle installer did not recognize the soft links as actual devices. After installing ASMLib and seeing (strace) how it actually created device files I got to digging deeper. Ultimately I created some UDEV rules which runs a script which sets up a directory structure and creates device files with 'mknod'. This all seems to work well but I like to understand the mechanics of things so:
a) Generally speaking, how are major and minor device numbers determined? I read some material that talked about devices "registering" with the kernel which sounds very dynamic to me. But I also read some other stuff about major numbers being standardized by the driver type (e.g. scsi) and the minor number being based on some predefined calculation possibly using the devices PCI address..
b) Is there any risk/detriment to having multiple device files point to the same physical device?
c) Why does UDEV no longer allow the renaming of devices but only creation of soft links?
d) Does anyone know if, when executing external scripts with the 'RUN' paramenter, there are any special considerations (e.g. exit codes, error detection) to look out for when creating the script?
e) I arbitrarily named my udev rules file '70-*'. There are many other rules files that are executed by udev so I want to make sure this won't cause any issues with those. However, I assume since I am simply creating new device files that didn't exist before (as opposed to modifying existing ones) there shouldn't be an issue. In a general sense, is there a deterministic means to choosing what number to name your rules with?
Thanks!
LJK
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
