Persistent SCSI device naming
With udev, you can define naming schemes that provide persistent SCSI device naming.
About this task
In persistent naming each device is always assigned the same unique name, independent of the sequence in which the devices are discovered. If a distribution has no predefined naming scheme for specific devices, or if a customized naming scheme is required, you can extend the set of rules for udev. Examples are given in the following paragraphs.
Procedure
Results
The new rule leaves the original device names
provided by the kernel intact and add symbolic links with the new
device names:
# ll /dev/my_zfcp_disk* lrwxrwxrwx 1 root root 3 Mar 14 16:14 /dev/my_zfcp_disk -> sda lrwxrwxrwx 1 root root 4 Mar 14 16:14 /dev/my_zfcp_disk1 -> sda1
A more general rule that applies to all FCP disks and provides a generic persistent name based on fcp_lun and WWPN can be written as:
KERNEL=="sd*[a-z]", SYMLINK+="scsi/%s{hba_id}-%s{wwpn}-%s{fcp_lun}/disk"
KERNEL=="sd*[0-9]", SYMLINK+="scsi/%s{hba_id}-%s{wwpn}-%s{fcp_lun}/part%n" Where:
- %s
- points to the information as it was given by the udevinfo command
With these rules, udev creates
links similar to the following examples:
# ll /dev/scsi/*/*
lrwxrwxrwx 1 root root 9 May 22 15:19
/dev/scsi/0.0.54ae-0x5005076300cb93cb-0x512e000000000000/disk -> ../../sda
lrwxrwxrwx 1 root root 10 May 22 15:19
/dev/scsi/0.0.54ae-0x5005076300cb93cb-0x512e000000000000/part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 May 22 15:19
/dev/scsi/0.0.54ae-0x5005076300cb93cb-0x512f000000000000/disk -> ../../sdb
lrwxrwxrwx 1 root root 10 May 22 15:19
/dev/scsi/0.0.54ae-0x5005076300cb93cb-0x512f000000000000/part1 -> ../../sdb1