My rules file looks as follows. This is showing the serial numbers instead of the scsi-ID to the master server via the media server. (I hope this is making sense) My lib is SL8500, which is similar to yours. Server is on RHEL5.6
I am working on solving this for my environment and thus in research stages of my project of making persistent binding happen when the hba vendor doesn't the utility to do it (as does qlogic with sansurfer). Anyway, here is what i have - that is working for me.
With OEL5.8 the /etc/udev/rules.d/50-udev.rules file will provide everything you need right out of the bag. Of course it will create nst entries as well, which we don't need, so to be tidy we can just remove those lines, so we see only sg entries in /dev/tape/by-id.
These are from an FC attached SL3000 library. So the udev rules show you the WWN on the fibre port, which you can easily link up to the correct drive using the SLC.
In the case of physical media I wouldn't advise linking your devices to the actual serial number on the drive, as then you have to reconfigure that when you swap the drive out due to a hardware fault. Virtual Tape Libraries will show you the serial number in udev and that is fine as a virtual drive will never fail.
Server Model: Sun Server X3-2L
Operating System: Oracle Enterprise Linux 5 Update 8 64 Bit
Tape Library: Sun StorageTek SL500
Tape Drive: 6x HP LTO-5 8Gb FC
SAN Switch: Brocade 300 with 24x 8Gb SFP
SAN Switch Zoning: One-to-One device zone (each zone has 1 storage device and 1 server device)
Backup Software: Oracle Secure Backup 10.0.4.0
I can found a document ID 971386.1 of Internal Support Portal. The document mentioned how to create persistent bindings for device. But unfortunately, I don't know how to edit and change the parameters of the file /etc/udev/rules.d/50-udev.rules for activate the persistent bindings for device.
Could you teach me how can I perform the persistent bindings for device? or give me the /etc/udev/rules.d/50-udev.rules sample how to change the parameters in the file? If persistent bindings works, can we perform the persistent bindings for device with customized order? Please see below for sample.
Like I said above, if you're running OEL5.8 the udev rules will do everything for you already (they didn't in previous releases). So there is no need to edit the rules file, unless you're like me and want to keep it clean and tidy and only map the sg entries.
From your list I can see that you have the persistent maps already, so basically you're all sorted.
Instead of specifying a /dev/sg entry in your device configuration, use the /dev/tape/by-id entry. For example, for your robot you would do this (I'm assuming that your library is known to OSB as "SL500")
obtool chdev -a hgcbk01:/dev/tape/by-id/scsi-3500104f000cc193e-changer SL500
I have another question. The device name will be changed after power cycle the tape library. Is this normal behavior of the Linux OS? In the Solaris OS, the device path will be remained even the tape library was inoperable, FC cable was disconnected and system rebooted.
For device name, I assume you mean the /dev/sg entry. Yes those are allowed to change based on how the kernel detects the devices. The same will happen to the sgen devices on Solaris too, but there you don't have udev to control it, so that is a bigger problem.