Forums

Home / Forums

You need to log in to create posts and topics. Login · Register

Command to see what IP is connected to an iSCSI disk

Is there a command that can be run to show what server is connected to a particular iscsi disk?

We have several disks that were created, but the name given to them doesn't help and the Client ACL was set to 'All'

 

I am not sure these disks are even being used, is there a way to tell if they are in use and mounted to some server, and if so, which server that is?

 

Thanks

Neil

You can list the connected iSCSI initiators to a particular disk path, example disk 00001 path 1 & 2:

cat /sys/kernel/config/target/iscsi/iqn.2016-05.com.petasan:00001/tpgt_1/dynamic_sessions
cat /sys/kernel/config/target/iscsi/iqn.2016-05.com.petasan:00001/tpgt_2/dynamic_sessions

You can view all connected client ips:

netstat -np | grep 3260

You can obtain more detail of client login connections by enabling kernel logs this works for new connections, you can also dynamically move path to force login,

enable-able debug logs
echo "file drivers/target/iscsi/iscsi_target_login.c +pf" > /sys/kernel/debug/dynamic_debug/control
dis-able debug logs
echo "file drivers/target/iscsi/iscsi_target_login.c -pf" > /sys/kernel/debug/dynamic_debug/control

Thanks so much! Very helpful information.