Sun Solaris 系统上安装Cisco iSCSI Driver
1. 概述
Cisco iSCSI Driver 提供给主机端通过IP网络访问存储设备的功能。该驱动通过iSCSI协议在主机端与iSCSI Target 端(即iSCSI存储设备)之间传输SCSI请求与应答。
2.实验环境
本次试验采用一台Sun V490服务器,安装Solaris9(sparc),建议安装Sun最新推荐补丁集,主机名为suntest2,。V490共6个10/100/1000Mbps自适应网口,将其中一个网口与IX5000的业务网口连接到同一交换机。Cisco iSCSI Driver 版本为
试验具体参数:Sun主机名:suntest2,ip 地址:201.201.10.26,网口:ce0。IX5000 Build版本为:9723,业务网口地址为:201.201.10.200。
3. 安装配置过程
a. 为了避免Sun主机中使用相同MAC地址的多个网口接入同一网络,推荐使用以下命令:
# eeprom local-mac-address?=true
b. 将solaris-iscsi-
# cd /tmp
# tar xvf solaris-iscsi-
c. 安装软件包:
# pkgadd –d . CSCOiscsi
如果安装正常,请直接到h
d. 此时,系统会提示无法安装此软件包,报错信息如下:
Cisco iSCSI device driver
(sparc)
Cisco Systems, Inc.
This appears to be an attempt to install the same architecture and
version of a package which is already installed. This installation
will attempt to overwrite this package.
You must be superuser to run this script!
Your current effective uid is 60002!
pkgadd: ERROR: request script did not complete successfully
Installation of <CSCOiscsi> failed.
No changes were made to the system.
e. 此时,需要更改Cisco iSCSI Driver软件安装包
#cd path_cisco_iscsi_driver
#cd CSCOiscsi
# ls
install pkginfo pkgmap reloc root
#cd install
修改request文件,如下部分:
原来:
# check for root privs
if [ -x /usr/xpg4/bin/id ] ; then
userid=`/usr/xpg4/bin/id -u`
if [ $userid -ne 0 ]
then
printf "You must be superuser to run this script!\n"
printf "Your current effective uid is $userid!\n"
exit 1
fi
fi
修改后:
# check for root privs
if [ -x /usr/xpg4/bin/id ] ; then
userid=`/usr/xpg4/bin/id -u`
if [ $userid -ne 0 ]
then
printf "You must be superuser to run this script!\n"
printf "Your current effective uid is $userid!\n"
# exit 1
fi
fi
f. 修改完成后,再安装Cisco iSCSI Driver软件包:
# pkgadd –d . CSCOiscsi
根据系统提示,进行安装,但是安装开始,由于修改了request文件,系统会认为安装包损坏,无法安装,提示以下信息:
Using </opt/CSCOiscsi> as the package base directory.
## Processing package information.
## Processing system information.
59 package pathnames are already properly installed.
pkgadd: ERROR: packaging file </export/home/CSCOiscsi/install/request> is corrup
t
file size <259> expected <2597> actual
file cksum <1021> expected <10214> actual
Installation of <CSCOiscsi> failed (internal error).
No changes were made to the system.
注意:
绿色的数字表示目前文件实际的file size和file cksum,而红色的部分是
/CSCOiscsi/pkgmap文件里对于request文件的描述,如下:
原来
1 i request 259 1021 1086153032
现在修改为绿色数字:
1 i request 2597 10214 1086153032
修改后保存退出
g. 再安装Cisco iSCSI Driver软件包:
# pkgadd –d . CSCOiscsi
此时,可以安装Cisco iSCSI Driver软件包
h. 更改iSCSI配置文件
# vi /etc/iscsi.conf
加入一行:DiscoveryAddress=201.201.10.200
# vi /etc/initiatorname.iscsi
加入一行:InitiatorName=iqn.suntest2
i. 在IX5000中创建一个volume,并与Initiator iqn.suntest2绑定
StorControl> volume assign name = suntest2vol initiatorName = iqn.suntest2
j. 重启操作系统
# reboot
重启时如果显示"WARNING: Failed to process interrupt for iscsi0 due to down-rev nexus driver scsipseudo0",可以忽略。重启后执行如下命令:
# devfsadm
k. 通过系统命令认到iSCSI盘
bash-2.05# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w210000008780b94d,0
1. c1t1d0 <SUN
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w
2. c2t0d0 <H
/iscsipseudo/iscsi@0/sd@0,0
Specify disk (enter its number):
其中c2t0d0为IX5000的volume,这时可以对该盘进行常规的系统操作。
4. Tips
a. 手动启动、停止iSCSI driver
# /etc/init.d/iscsi start
# /etc/init.d/iscsi stop
b. 察看iSCSI设备状态
# /usr/sbin/iscsi-ls –l
c. 动态重配驱动
编辑/etc/iscsi.conf后,执行
# /etc/init.d/iscsi reload
d. 对于多于一个LUN时操作系统的设置,编辑sd.conf文件
# vi /kernel/drv/sd.conf
加入如下信息(本例format看到的iSCSI盘的target号为0)
name="sd" parent="iscsi" target=0 lun=0;
name="sd" parent="iscsi" target=0 lun=1;
name="sd" parent="iscsi" target=0 lun=2;
name="sd" parent="iscsi" target=0 lun=3;
name="sd" parent="iscsi" target=0 lun=4;
name="sd" parent="iscsi" target=0 lun=5;
name="sd" parent="iscsi" target=0 lun=6;
e. 如果需要启动时自动挂载,编辑/etc/vfstab文件,将iSCSI盘的mount at boot选项设为iscsi,例如:
*************************************************************************
#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
/dev/dsk/c1t5d0s6 /dev/rdsk/c1t5d0s6 /mnt/t5 ufs 1 iscsi -
/dev/dsk/c1t6d0s6 /dev/rdsk/c1t6d0s6 /mnt/t6 ufs 1 iscsi -
*************************************************************************
若您有关于案例的建议,请反馈:
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作