Command to see what IP is connected to an iSCSI disk
neiltorda
98 Posts
June 28, 2023, 1:26 pmQuote from neiltorda on June 28, 2023, 1:26 pmIs 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
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
admin
2,930 Posts
June 28, 2023, 3:20 pmQuote from admin on June 28, 2023, 3:20 pmYou 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
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
neiltorda
98 Posts
June 28, 2023, 6:19 pmQuote from neiltorda on June 28, 2023, 6:19 pmThanks so much! Very helpful information.
Thanks so much! Very helpful information.
Command to see what IP is connected to an iSCSI disk
neiltorda
98 Posts
Quote from neiltorda on June 28, 2023, 1:26 pmIs 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
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
admin
2,930 Posts
Quote from admin on June 28, 2023, 3:20 pmYou 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_sessionsYou 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
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
neiltorda
98 Posts
Quote from neiltorda on June 28, 2023, 6:19 pmThanks so much! Very helpful information.
Thanks so much! Very helpful information.