[CentOS] Persistent iSCSI Device Names on CentOS 4

Tue Nov 13 21:47:26 UTC 2007
Jay Leafey <jay.leafey at mindless.com>

I found a lot of stuff about this on the web, but never an answer that 
worked.  One of the most promising hints was about udev maintaining 
links in the /dev/disk/by-* directories.  This works just fine in CentOS 
5, but not CentOS 4.  As I was trying to use the iSCSI devices as VMware 
disks this was particularly frustrating.  After banging my head on this 
for a while, I figured out how to make it work.

By default, iSCSI devices don't show up in the /dev/disk/by-* 
directories maintained by udev under CentOS 4.  After looking at the 
scripts used by udev, it appeared that the scsi_id program was not 
returning anything for the iSCSI devices.  Digging in the manpage and 
the /etc/scsi_id.config file led me to believe that the devices in 
question were "blacklisted" and never returned a valid device ID.

The fix was to add a line to scsi_id.config to whitelist the particular 
devices.  In my case, the iSCSI devices are provided by on Openfiler 
box, which shows up in /proc/scsi/scsi like this:

Host: scsi2 Channel: 00 Id: 00 Lun: 00
   Vendor: Openfile Model: Virtual disk     Rev: 0
   Type:   Direct-Access                    ANSI SCSI revision: 04

The fix for me was to add the following line to my iscsi_id.config file:

vendor=Openfile, model="Virtual disk", options=-g

The values for "vendor=" and "model=" will vary with the specific iSCSI 
target used.  After adding this and rebooting, udev now properly 
maintains the links in /dev/disk/by-id/ for each of the iSCSI devices 
offered up to my workstation.

Hope that helps somebody!
-- 
Jay Leafey - Memphis, TN
jay.leafey at mindless.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5177 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20071113/65f07e95/attachment-0004.bin>