iSCSI on a Red Hat based distro

After the previous article I wanted to get it working on Linux. Let me say it is a little more tricky to get this going. For the Red Hat based distro you can use YUM to install the iscsi utilities. Once it was installed you have to go into the /etc/iscsi/iscsid.conf file and edit the entries if you are using CHAP to authenticate the connections to the SAN. You will need to be or have root permissions to edit it. I will post an example of this file at the end. Now you are ready to start the iSCSI service and enter /etc/init.d/iscsi start . Then enter (iscsiadm -m discovery -t sendtargets -p 192.xxx.xxx.xxx) this will allow you to discover targets on the SAN. Then you restart the iscsid service. With that completed you should be able to see the targets on you machine, however if the targets have not been used before you will need to make the partition and format the drive. Then is should show up in the system drives. If not you can run the command fdisk -l to show all of the disks that are installed on the machine. Then you can have it mount automatically with the following command (chkconfig iscsi on), and add the following syntax to the fstab (/dev/sdd1 /mnt/iscsi ext3 _netdev 0 0). I would think you could do the same thing with Ubuntu or Debian by replacing the yum install with (sudo apt-get install open-iscsi).

Here is part of the iscsid.conf file:

#
# Open-iSCSI default configuration.
# Could be located at /etc/iscsi/iscsid.conf or ~/.iscsid.conf
#
# Note: To set any of these values for a specific node/session run
# the iscsiadm –mode node –op command for the value. See the README
# and man page for iscsiadm for details on the –op command.
#
################
# iSNS settings
################
# Address of iSNS server
#isns.address = 192.168.0.1
#isns.port = 3205
#############################
# NIC/HBA and driver settings
#############################
# open-iscsi can create a session and bind it to a NIC/HBA.
# To set this up see the example iface config file.
#*****************
# Startup settings
#*****************
# To request that the iscsi initd scripts startup a session set to “automatic”.
# node.startup = automatic
#
# To manually startup the session set to “manual”. The default is automatic.
node.startup = automatic
# *************
# CHAP Settings
# *************
# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
#node.session.auth.authmethod = CHAP
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
#node.session.auth.username = username
#node.session.auth.password = password
# To set a CHAP username and password for target(s)
# authentication by the initiator, uncomment the following lines:
#node.session.auth.username_in = username_in
#node.session.auth.password_in = password_in
# To enable CHAP authentication for a discovery session to the target
# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
#discovery.sendtargets.auth.authmethod = CHAP
# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
#discovery.sendtargets.auth.username = username
#discovery.sendtargets.auth.password = password
# To set a discovery session CHAP username and password for target(s)
# authentication by the initiator, uncomment the following lines:
#discovery.sendtargets.auth.username_in = username_in
#discovery.sendtargets.auth.password_in = password_in

I don’t use CHAP so I didn’t have to configure this file.  I installed the initiator, started the service, and logged on to the SAN.  Everything worked great after that.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.