====== iSCSI Initiator (client) ====== As root. ===== Install open-iscsi package ===== <code> > apt-get install open-iscsi Setting up open-iscsi (2.0.873+git0.3b4b4500-1) ... update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults </code> ===== Configure initiator ===== <code> > nano -c /etc/iscsi/iscsid.conf # line 53: uncomment node.session.auth.authmethod = CHAP # line 57,58: uncomment and set username and password which set on iSCSI Target node.session.auth.username = username node.session.auth.password = password > /etc/init.d/open-iscsi restart </code> ==== Adding an appropriate IP address ==== Depending on the server's iscsi portal configuration, it might be necessary to add an appropriate IP address to the initiator's machine network interface (NIC). If this is required, here is how to do it, in this case temporarily adding the appropriate IP address to the eth0 interface ([[https://www.garron.me/en/linux/add-secondary-ip-linux.html|reference]]): <Code:bash> > sudo ip address add 10.1.1.55/24 dev eth0 </Code> Once done, the temporary IP address can be removed using: <Code:bash> > sudo ip address del 10.1.1.55/24 dev eth0 </Code> ===== discover target ===== <code> > sudo iscsiadm -m discovery -t sendtargets -p <10.0.0.50> 10.0.0.50:3260,1 iqn.2013-05.world.server:target00 </code> === Confirm status after discovery === <code> > sudo iscsiadm -m node -o show [-n iqn.2013-05.world.server:target00] # BEGIN RECORD 2.0-873 node.name = iqn.2013-05.world.server:target00 node.tpgt = 1 node.startup = manual node.leading_login = No ..... ..... # END RECORD </code> === Login to target === <color darkslateblue>**Login to all targets**</color> <code> > sudo iscsiadm -m node --login Logging in to [iface: default, target: iqn.2013-05.world.server:target00, portal: 10.0.0.50,3260] (multiple) Login to [iface: default, target: iqn.2013-05.world.server:target00, portal: 10.0.0.50,3260] successful. </code> <color darkslateblue>**Login to one target**</color> <code> > sudo iscsiadm -m node --target iqn.2014-05.4d --portal 10.1.1.2:3260 --login </code> Associated iSCSI disks should show up on the machine. <color darkslateblue>**Disconnect from node (unmounting iSCSI volumes):**</color> <code> > sudo iscsiadm -m node -u </code> === Confirm session === <code> > sudo iscsiadm -m session -o show tcp: [1] 10.0.0.50:3260,1 iqn.2013-05.world.server:target00 </code> === Confirm partitions === <code> > cat /proc/partitions major minor #blocks name 8 0 488386584 sda 8 1 204800 sda1 8 2 26460160 sda2 8 3 1 sda3 8 5 435505152 sda5 8 6 10485760 sda6 8 7 5242880 sda7 8 8 10482688 sda8 11 0 1048575 sr0 8 16 204800 sdb </code> ----- On Debian, iSCSI discovery stores nodes (targets to extents associations, or LUNs) in **/etc/iscsi/nodes** ----- === iSCSI Documentation === [[https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/iscsilogin.html]]