netapp linux iscsi 实现
环境:Redhat linux AS5,netapp simulator 7.3.4
操作步骤:
linux主机端
1.安装initiator。
 [root@linux ~]# rpm –ivh iscsi-initiator-utils-6.2.0.742-0.5.el5.i386.rpm
 安装完后会在/etc/iscsi下生成两个文件
 initiatorname.iscsi和iscsid.conf
2.启动iscsi服务
  有2种方法
  A: service iscsi start/restart
  B:cd /etc/init.d
     ./iscsi start
3.检查iscsi服务的状态
  chkconfig --list|grep iscsi

确定运行后,记录下initiatorname
  [root@Redhat ~]# cat /etc/iscsi/initiatorname.iscsi
        InitiatorName=iqn.1994-05.com.redhat:23a52db21754
存储端
1.添加license协议
license add xxxxxxx
2.创建igroup
igroup create -i -t linux linuxas5 iqn.1994-05.com.redhat:23a52db21754
3.创建灵活卷
vol create vol1 aggr1 60m
4.创建lun
lun create -s 40m -t linux -o noreserve /vol/vol1/lun0
5.map lun
lun map /vol/vol1/lun0 linuxas5 0
6.check lun's status
if lun offline,you need to online : lun online /vol/vol1/lun0

再回到linux主机端
1.发现lun,获得target的inode。
  #iscsiadm -m discovery -t st -p "存储ip"
iscsiadm -m discovery -t st -p 192.168.100.20
192.168.100.20:3260,2000 iqn.1992-08.com.netapp:sn.×××9383
2.挂载登陆lun
#iscsiadm -m node -T iqn.1992-08.com.netapp:sn.×××9383 -p 192.168.100.20 -l
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
logout lun(这个只是测试的时候可以用)
iscsiadm -m node -T iqn.1992-08.com.netapp:sn.×××9383 -p 192.168.100.20 -u
//////////////////////////////////////////////////////////////////////
         关于上面的操作,可以修改/etc/iscsi/iscsid.conf实现
vi /etc/iscsi/iscsid.conf
在最后加上:
DiscoveryAddress = 192.168.100.20  //target's Ip address//
SendAsyncText = yes //Initiator能从客户端接收到Vendor Specific的同步事件//
Continuous = yes //为了能指定全部依然打开的会话//
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.主机发现lun
  fdisk -l
4.格式化lun
fdisk /dev/sdb
mkfs -t ext3 /dev/sdb1
5.设置挂载目录
mkdir /raid/sdb1
mount /dev/sdb1 /raid/sdb1
6.设置自动挂载位置,编辑/etc/fstab
#vi /etc/fstab
/dev/sdb1 /raid/sdb1 ext3 _netdev 0 0
7.查看容量
df -h


操作完毕