How do I access iSCSI Target (server) via iSCSI initiator (client)?

Following is a quick way to access iSCSI target, under RHEL 5. Let us say your server iSCSI Target IP is 192.168.1.2. Type the following command to discover targets at a given IP address such as 192.168.1.2 (use 127.0.0.1 if you are testing it from same computer):

# iscsiadm –mode discovery –type sendtargets –portal 192.168.1.2
OR
# iscsiadm –mode discovery –type sendtargets –portal 127.0.0.1
Sample output:
127.0.0.1:3260,1 iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz
Login to the iscsi target session:
# iscsiadm –mode node –targetname iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz –portal 192.168.1.2:3260 –login
OR
# iscsiadm –mode node –targetname iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz –portal 127.0.0.1:3260 –login
Verify that login was successful:
# tail -f /var/log/messages

 

Leave a Comment