Here is an introduction to storage Device Names Managed by the udev mechanism (/dev/disk/by-*)
The udev mechanism consists of three major components:
Generates events taht are sent to userspace when devices are added, removed or changed.
The udevd daemon
Receives the events.
The udev rules
Specifies the action to take when the ud ev daemon receives the kernel events.
This mechanism is used for all types of devices in Linux, not just for storage devices. In the case of storage devices, Red Linux Enterprise Linux contains ud ev rules that create symbolic links in the /dev/disk directory allowing storage devices to be referred to by their contents, a unique identifier, their serial number, or the hardware path used to access the device.
Entries in this directory provide a symbolic name that refers to the storage device by a label in the contents (that is, the data) stored on the device. The bl ki d program is used to read data from the device and determine a name (that is, a label) for the device. For example:
The information is obtained from the contents (that is, the data) on the device so if the contents are copied to another device, the label will remain the same.
The label can also be used to refer to the device in /etc/fstab using the following syntax:
Entries in this directory provide a symbolic name that refers to the storage device by a unique identifier in the contents (that is, the data) stored on the device. The blkid program is used to read data from the device and obtain a unique identifier (that is, the uuid) for the device. For example:
Entries in this directory provide a symbolic name that refers to the storage device by a unique identifier (different from all other storage devices). The identifier is a property of the device but is not stored in the contents (that is, the data) on the devices. For example:
The id is obtained from the world-wide ID of the device, or the device serial number. The /dev/disk/by-id entries may also include a partition number. For example:
Entries in this directory provide a symbolic name that refers to the storage device by the hardware path used to access the device, beginning with a reference to the storage controller in the PCI hierachy, and including the SCSI host, channel, target, and LUN numbers and, optionally, the partition number. Although these names are preferable to using major and minor numbers or sd names, caution must be used to ensure that the target numbers do not change in a Fibre Channel SAN environment (for example, through the use of persistent binding) and that the use of the names is updated if a host adapter is moved to a different PCI slot. In addition, there is the possibility that the SCSI host numbers could change if a HBA fails to probe, if drivers are loaded in a different order, or if a new HBA is installed on the system. An example of by-path listing is:
The /dev/disk/by-path entries may also include a partition number, such as: