CentOS 4 / Redhat Enterprise Linux 4 iSCSI Installation and Configuration ( iscsi initiators )

I've received a couple of email about setting up iSCSI under CentOS 4 or RHEL ES 4 server. Previously, I wrote about iSCSI under CentOS 5 / RHEL 5 server.

Requirements

[a] Following instructions tested on RHEL ES 4 and CentOS 4 only. (See RHEL 5/ CentOS 5 / Debian/ Ubuntu Linux specific instructions here).
[b] You need following information
[c] ISCSI Username
[d] ISCSI Password
[e] ISCSI Server IP / hostname

CentOS Linux v4.x - Install iscsi-initiator-utils

Type the following command:
# yum install iscsi-initiator-utils

Redhat ES Linux v4.x - Install iscsi-initiator-utils

Type the following command:
# up2date iscsi-initiator-utils

Configure iSCSI

Open /etc/iscsi.conf file, enter:
# vi /etc/iscsi.conf
Setup it as follows:

DiscoveryAddress=ISCSI_TARGET_HOST_OR_IP
 OutgoingUserName=ISCSI_USER_NAME
 OutgoingPassword=ISCSI_PASSWORD
 LoginTimeout=15

Save and close the file.

Start the iscsi service

Type the following command to start iscsi service so that you can see block device:
# chkconfig iscsi on
# /etc/init.d/iscsi start

Run any one of the following to find out new block device name:
# fdisk -l
# tail -f /var/log/messages
# find /sys/devices/platform/host* -name "block*"

Format iSCSI device

Use fdisk and mkfs.ext3 commands. First, create a partition (assuming that /dev/sdc is a new block device assigned to iscsi) :
# fdisk /dev/sdc
# mkfs.ext3 /dev/sdc1

Create /mnt/iscsi directory:
# mkdir -p /mnt/iscsi
Open /etc/fstab file and append config directive:
/dev/sdc1 /mnt/iscsi ext3 _netdev 0 0
Save and close the file. Mount the parition /dev/sdc1:
# mount -a
# df -H

Continue reading rest of the Linux iSCSI Storage Configuration series.

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 3 comments… read them below or add one }

1 Ajeet 07.10.08 at 12:01 pm

I am in attempt to setup two Node Cluster with iSCSI as alternative to Shared Storage.I configured target and initiator successfully.
Now When I ran on one of client :

#find /sys/devices/platform/host* -name “block*”
/sys/devices/platform/host1/target1:0:0/1:0:0:0/block

As for info,I have ran the following commands on client:

followed as said in the doc and found it this way:

[root@BL02DL385 ~]# rpm -ivh iscsi-initiator-utils-4.0.3.0-6.x86_64.rpm

warning: iscsi-initiator-utils-4.0.3.0-6.x86_64.rpm: V3 DSA signature: NOKEY, key ID 9b3c94f4

Preparing… ########################################### [100%]

1:iscsi-initiator-utils ########################################### [100%]

[root@BL02DL385 ~]# vi /etc/iscsi.conf

DiscoveryAddress=10.14.236.134

# OutgoingUsername=fred

# OutgoingPassword=uhyt6h

# and/or

#

DiscoveryAddress=10.14.236.134

# IncomingUsername=mary

# IncomingPassword=kdhjkd9l

#

[root@BL02DL385 ~]# service iscsi start

Checking iscsi config: [ OK ]

Loading iscsi driver: [ OK ]

Starting iscsid: [ OK ]

[root@BL02DL385 ~]# CD /proc/scsi/scsi

-bash: CD: command not found

[root@BL02DL385 ~]# vi /proc/scsi/scsi

It is Displaying so:

Attached devices:

Host: scsi0 Channel: 00 Id: 00 Lun: 00

Vendor: IET Model: VIRTUAL-DISK Rev: 0

Type: Direct-Access ANSI SCSI revision: 04

~

~

Is it working fine?

The entry for target ietd.conf file is:
Target iqn.2008-07.com.logica.vjs:storage.lun1

IncomingUser

OutgoingUser

Lun 0 Path=/root/cluster_share,Type=fileio

Alias iDISK0

2 mouli 04.17.09 at 5:11 pm

Hi,

I have installed iscsi in redhat 5 and configured through via 100mbs netwotk card. I have one more network card int his server. How can I discovver the iscsi disk via diffrent network card to setup multi path..

Pls help me

3 Vivek Gite 04.17.09 at 6:13 pm

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Previous post: Read the Fine Print on "Open Source" Software

Next post: Ubuntu Software Update How To