Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)? – LawrenceC 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
up vote 5 down vote accepted

If you look into


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


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.