Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have some iSCSI targets mounted on a linux host as /dev/sd*. How can I query the iSCSI ID from the device node?

This is on CentOS 5, using the iscsi-initiator-utils package.

share|improve this question
    
Does lsscsi --verbose give you this information (haven't played with iSCSI much)? –  ultrasawblade Mar 14 '11 at 15:16
    
Doesn't seem to. There's also a --long option, but no joy there either. It prints handy paths into /sys for the device, but I can't see any iSCSI IDs in there either. –  kdt Mar 14 '11 at 15:34

3 Answers 3

up vote 1 down vote accepted

If you look into

 /dev/disk/by-path/

you should see links to your devices

share|improve this answer
    
Fabulous, thank you. –  kdt Mar 14 '11 at 15:41
    
Thanks Daniel! I didn't know that. –  sciurus Mar 16 '11 at 2:08
iscsiadm --mode session -P 3

That will produce lots of extraneous output. You care about the Target line that comes before the Attached scsi disk line for the device in question.

share|improve this answer
    
Yep, that works. –  kdt Mar 15 '11 at 12:19

I'm pretty sure you can get the ID by issuing iscsiadm -m discovery -t st -p <target-ip>.

share|improve this answer
    
Unfortunately that command only lists all IDs for a server, it doesn't let me match them up with local device nodes. –  kdt Mar 14 '11 at 15:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.