Pages

Saturday, February 6, 2010

How to configure iSCSI on Linux -Red hat

A very common question and issue among the new bee is How-to Configure iSCSI On Linux? So here we go ..


Step 1:

First check on your system if you have iSCSI rpm installed:
#rpm -qa iSCSI

if not then install the iSCSI packages


Step 2:

Install the Open-iSCSI initiator utils:
# yum -y install iscsi-initiator-utils

Edit /etc/iscsi/iscsid.conf and set your username and password, only if you use CHAP authentication to your iSCSI service.

Step 3:

Most likely, you will have to allow access to the iSCSI volume on the array, so log into your NAS admin interface and authorize your Linux host either by username, IP, or initiator name. You can find your Linux host's initiator name in:
/etc/iscsi/initiatorname.iscsi

Step 4:

Set iscsi to start on boot, and start it now:
# chkconfig iscsid on ; service iscsid start
# chkconfig iscsi on ; service iscsi start


Step 5:

Use iscsiadm to discover your iSCSI targets, replacing the IP with your own portal IP:
# iscsiadm -m discovery -t st -p 192.168.0.10

Step 6:

Once discovery gets you the target names, log into the one you want to work with:
# iscsiadm -m node -T iqn.2123-01.com:blah:blah:blah \
-p 192.168.0.10 -l


If you want to automatically login at boot:
# iscsiadm -m node -T iqn.2123-01.com:blah:blah:blah \
-p 192.168.0.10 -o update -n node.startup -v automatic


Step 7:

Now the iSCSI volume should be detected by your system as a block device. You can check what device it was detected as by tailing your log.
# tail -n 50 /var/log/messages

Now the system is ready for creating partition and file system. You can use fdisk or LVM to do the same.

Cheers,
All the Best...... :)

1 comment:

  1. Could u plz include steps to manually build ....
    For some one with without network access to the server it would be beneficial

    Thanks

    ReplyDelete