I'm using iscsi-initiator-utils successfully to use some iscsi devices on CentOS 5, and I have some symlinks created by udev in /dev/disk:
# ls -l /dev/disk/by-path/ip-* /dev/disk/by-id/scsi-* lrwxrwxrwx 1 root root 9 Sep 29 15:41 /dev/disk/by-id/scsi-14f504e46494c45006779706e4d772d746d36582d6869556e -> ../../sdb lrwxrwxrwx 1 root root 9 Sep 29 15:41 /dev/disk/by-path/ip-192.168.20.149:3260-iscsi-iqn.2006-01.com.openfiler:tsn.0a16ba8cb6c9-lun-0 -> ../../sdb
I know that the by-path one is the IQN of the device, and I presume that the by-id one is a SCSI device identifier.
I would like to know how to get these values myself from e.g. /dev/sdb.
scsi_id -g /dev/sdb returns nothing.
(I know I could map symlinks back and scrap the IDs from the filenames, but that would be redundant: udev is getting those IDs from somewhere, and I'd like to know where).