日期:2014-05-16 浏览次数:20728 次
一:Install iSCSI target for Linux
1,操作系统:
[root@rac2 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux AS release 4 (October Update 4)
Kernel r on an m
[root@rac2 /]# uname -a
Linux rac2.mycorpdomain.com 2.6.9-42.0.0.0.1.ELsmp #1 SMP Sun Oct 15 14:02:40 PDT 2006 i686 i686 i386 GNU/Linux
[root@rac2 /]#
2,解压文件
[root@rac2 ~]# tar -xzvf iscsitarget-0.4.15.tar.gz
3,编译
[root@rac2 ~]# cd iscsitarget-0.4.15
[root@rac2 iscsitarget-0.4.15]# ls
ChangeLog COPYING doc etc include kernel Makefile patches README README.vmware usr
[root@rac2 iscsitarget-0.4.15]# make
[root@rac2 iscsitarget-0.4.15]# make install
?
4,配置
[root@rac2 iscsitarget-0.4.15]# vi /etc/ietd.conf
User userid superpassword
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz
Lun 0 /dev/sdb1 fileio
Alias lun0
5,启动服务
[root@rac2 etc]# cd /etc/init.d
[root@rac2 init.d]# ls
6,察看验证
dmesg -c
?
7,修改配置文件为:
Target iqn.2001-04.com.example:storage.disk2.sys1.idisk
Lun 4 Path=/dev/sdb1,Type=fileio
Alias sdb
然后启动的时候dmesg信息为:
iSCSI Enterprise Target Software - version 0.4.15
iotype_init(92) register fileio
iotype_init(92) register blockio
iotype_init(92) register nullio
日志信息:
Oct 25 16:31:35 test kernel: iSCSI Enterprise Target Software - version 0.4.15
Oct 25 16:31:35 test kernel: iotype_init(92) register fileio
Oct 25 16:31:35 test kernel: iotype_init(92) register blockio
Oct 25 16:31:35 test kernel: iotype_init(92) register nullio
在这个地方我搞了好久,看大家的文章一直配置文件都是可以如下配置的:
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz
Lun 0 /dev/sdb1 fileio
Alias Test
但是我的一直不行,我原来是虚拟机,然后重新安装了redhat4u4,还是不行,后来有安装了redhat5,还是不行.
中间我也试过用如下配置文件:
User userid superpassword
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz
Lun 0 Path=/dev/sdb1, type=fileio
Alias Test
可是还不行,最后发现type开头字母我把它写成小写了.
二,Red Hat linux iSCSI initiator configuration
1,操作系统:
[root@rac1 ~]# cat /etc/issue
Enterprise Linux Enterprise Linux AS release 4 (October Update 4)
Kernel r on an m
[root@rac1 ~]#
2,安装initiator
[root@rac1 ~]# rpm -ivh iscsi-initiator-utils-4.0.3.0-4.i386.rpm
warning: iscsi-initiator-utils-4.0.3.0-4.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:iscsi-initiator-utils ########################################### [100%]
[root@rac1 ~]#
3,修改/etc/iscsid.conf 文件
vi /etc/iscsid.conf
修改下面3项:
DiscoveryAddress=<IP Address>
This needs to be set to the Group IP Address of your UIT Array.
SendAsyncText=yes
For the initiator to receive Vendor Specific async events from the target.
Continuous=yes
To globally specify that all discovery sessions be kept open.
4,启动服务
[root@rac1 etc]# service iscsi start
Checking iscsi config: [ OK ]
Loading iscsi driver: [ OK ]
mknod: `/dev/iscsictl': File exists
Starting iscsid: [ OK ]
[root@rac1 etc]#
5,设置iscsi服务
[root@rac1 etc]# chkconfig --list iscsi
[root@rac1 etc]# chkconfig --add iscsi
[root@rac1 etc]# chkconfig --add iscsi
[root@rac1 etc]# chkconfig iscsi on
[root@rac1 etc]# chkconfig --list iscsi
iscsi 0:off 1:off 2:on 3:on 4:on 5:on 6:off
6,察看scsi设备
[root@rac1 etc]# iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11-3(02-May-2006)
*******************************************************************************
[root@rac1 etc]#
7, 正常情况下应该是:
[root@rac1 ~]# iscsi-ls
*****************************************************************