from http://www.server-world.info/en/note?os=CentOS_6&p=iscsi&f=2 This example is based on the environment below. +----------------------+ | +----------------------+ | [ iSCSI Target ] |10.0.0.30 | 10.0.0.31| [ iSCSI Initiator ] | | dlp.server.world +----------+----------+ www.server.world | | | | | +----------------------+ +----------------------+ All of the below commands take place on the initiator machine. Install initiator utils. [root@www ~]# yum -y install iscsi-initiator-utils Set the initiator name in /etc/iscsi/initiatorname.iscsi Configure /etc/iscsi/iscsid.conf: Some strongly recommended settings: # if this is not set to manual, iscsi will try to connect to every target # it sees: node.startup = manual node.session.auth.authmethod = CHAP # disable these on specific targets, if the target does not support it: node.conn[0].iscsi.HeaderDigest = CRC32C # note: actually not supported in initiator yet at time of writing, but # recommended to enable it when it is: # node.conn[0].iscsi.DataDigest = CRC32C The defaults are fine for most other settings; pay attention to the places that mention specific settings for different types of iSCSI targets, e.g. EqualLogic. Do not set a CHAP username & password here, as that will result in iscsi trying to use those credentials for every connection on every target (probably not correct). Connect to the target server and get a list of available targets: iscsiadm --mode discovery --type sendtargets --portal 10.0.0.30 Depending on the target server's settings, this may produce a long list of targets you don't want. Either delete the cached references to these targets you don't want, or verify that their startup type is 'manual': List the currently cached target references: iscsiadm -m node Check its startup type (to show all startup types, just omit the "--targetname" parameter): iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 -o show | grep startup Delete a discovered target reference: iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 -o delete Set the CHAP credentials for the target you want: iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 -o update -n node.session.auth.username -v <username> iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 -o update -n node.session.auth.password -v <password> Connect the target: iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 --login See what device name it got: ls -l /dev/disk/by-path/ Session status: iscsiadm -m session -P 3 If you want this connection to be persistent: Set the startup type to automatic: iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 -o update -n node.startup -v automatic Use UUIDs for mounting, or the persistent device name for it from /dev/disk/by-path/ Set the "_netdev" mount option when adding to fstab, e.g.: UUID=71e86162-011d-49f1-9b4a-9f95a277e6b5 /mnt/data ext4 _netdev,rw 0 0 Disconnect from a target: iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 --logout Delete the cached reference, if you do not need to connect to it again later: iscsiadm -m node --targetname iqn.2001-05.com.something:0-8a0906 -o delete