1

find disks corresponding to iscsi target on linux

view story
linux-howto

http://stackoverflow.com – I need to write a script to automatically login to a target and mount the disk corresponding it. I use iscsiadm to login to the target.But i don't know how to find out the disk corresponding to a certain target. By now the only way i tried is to use /dev/disk/by-patch/ip-xxx-iscsi-partx. It's a little complex. I wan't know whether there is a file or something the like with the relationship of iscsi target and disk recorded. The programming language i am using is python. And i hope there is some better way to implement this. (HowTos)