by Vivek Gite on May 13, 2008
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
Type the following command:
# yum install iscsi-initiator-utils
Type the following command:
# up2date iscsi-initiator-utils
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.
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*"
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
by Jens (and RedHat )
iSCSI Node Name Guidelines
The entire node name can be up to 223 bytes in length No white space is allowed Node names are not case sensitive The following ASCII characters can be used: * dash ('-') * dot ('.') * colon (":") * numbers 0-9 * lower-case letters a-z
The node name of the initiator is stored in the /etc/initiatorname.iscsi
file. Red Hat recommends the use of the command /sbin/iscsi-iname
to generate a random node name, which can then be customized by the administrator. Using the system name or function (i.e. mail-server-1
or oracle-3
) as the unique portion of the name can simplify iSCSI administration. An example initiatorname.iscsi file is shown below:
## DO NOT EDIT OR REMOVE THIS FILE! ## If you remove this file, the iSCSI daemon will not start. ## If you change the InitiatorName, existing access control lists ## may reject this initiator. The InitiatorName must be unique ## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames. InitiatorName=iqn.1987-05.com.cisco:01.myschnukki-1