BBS.ChinaUnix.net
首页 | 新闻 | Linux | FreeBSD | AIX | Windows | 博客 | 论坛 | 存储 | 网络 | 人才 | Wiki | 资料 | 读书 | 手册 | 下载 | 空间 | 搜索
  会员: 密码: 免费注册 | 忘记密码 | 会员登录 | 搜索 | 帮助 


首页 » 论坛 » BSD »  
[打印] [订阅] [收藏] [本帖文本页] [推荐此主题给朋友,立即获积分]
啊泰
风云使者



UID:481942
注册:2006-10-26
最后登录: 2008-09-04
帖子:411
精华:0

可用积分:338 (白手起家)
信誉积分:105
空间积分:0 (白手起家)
专家积分:0 (本版)

状态:...离线...

[个人空间] [短信] [博客]


顶部
1楼 发表于 2008-6-28 19:51 
Q. How do I install and configure iSCSI initiator service under FreeBSD server?

A. FreeBSD 7.x has full support for iSCSI. Older version such as FreeBSD 6.3 requires backport for iSCSI. Following instruction are known to work under FreeBSD 7.0 only.

FreeBSD iscsi_initiator driver
The iscsi_initiator implements the kernel side of the Internet SCSI (iSCSI) network protocol standard, the user land companion is iscontrol and permits access to remote virtual SCSI devices via cam.

Compile driver
Please note that FreeBSD 7.x has this driver compiled by default. You can skip this step if driver exists at /boot/kernel/iscsi_initiator.ko. To compile this driver into the kernel,
# cd /usr/src/sys/i386/conf
# cp GENERIC ISCSIKERNEL
# vi ISCSIKERNEL
Place the following lines in your kernel configuration file:
device iscsi_initiator
Save and close the file. Building a Kernel, type the following commands:
# cd /usr/src
# make buildkernel KERNCONF=ISCSIKERNEL
Install the new kernel:
# make installkernel KERNCONF=ISCSIKERNEL
Now reboot the system:
# reboot
Install iSCSI Initiator driver under FreeBSD
You need FreeBSD kernel driver for the iSCSI protocol. You need to use driver called /boot/kernel/iscsi_initiator.ko. You can load this driver by typing following command as root user:
# kldload -v iscsi_initiator.ko
Output:

Loaded iscsi_initiator.ko, id=6Alternatively, to load the driver as a module at boot time, place the following line in /boot/loader.conf:
# vi /boot/loader.conf
# Beginning of the iSCSI block added by Vivek
iscsi_initiator_load="YES"
# End of the block added by Vivek
Save and close the file.

FreeBSD iscontrol command to login / negotiator / control for an iSCSI initiator session
Now, you need to use iscontrol command. First, do a discovery session and exit:
# iscontrol -d targetaddress=iSCSI-SERVER-IP-ADDRESS initiatorname=nxl
# iscontrol -v -d targetaddress=192.168.1.100 initiatorname=nxl
Please note down the list of available targetnames/targetadresses. Once you know the target name, edit /etc/iscsi.conf file:
# vi /etc/iscsi.conf
Append config directives as follows:

officeiscsi {
        authmethod      = CHAP
        chapIName       = YOUR-ISCSI-USERNAME
        chapSecret      = YOUR-ISCSI-PASSWORD
        initiatorname   = nxl
        TargetName      = iqn.XYZZZZZZZZZZZZZ #  whatever "iscontrol -v -d " gives you
        TargetAddress   = 192.168.1.100:3260,1 # your iscsi server IP
}Save and close the file.
Where,

officeiscsi { : Start config for iSCSI.
authmethod : Set authentication method to chap
chapIName : Your username
chapSecret : Your password
initiatorname : if not specified, defaults to iqn.2005-01.il.ac.huji.cs:<hostname>
TargetName : is the name by which the target is known, not to be confused with target address, either obtained via the target administrator, or from a discovery session.
TargetAddress : is of the form domainname[:port][,portal-group-tag] to quote the RFC: The domainname can be specified as either a DNS host name, a dotted-decimal IPv4 address, or a bracketed IPv6 address as specified in [RFC2732].
} : End of config
Start an iSCSI session
The following command will read options from /etc/iscsi.conf, use the targetaddress found in the block nicknamed myiscsi, login and negotiate whatever options are specified, and start an iscsi-session.
# iscontrol -c /etc/iscsi.conf -n officeiscsi
Once you run the iscontrol command it should create a new device in /dev directory. To see the device name run dmesg command:
# dmesg
Format iSCSI volume
Now run sysinstall command to format just discovered iSCSI device name at /dev location:
# sysinstall
Select Custom > 3 Partition > Select iSCSI device name such as da1. Once formatted just mount device, enter:
# mkdir /iscsi
# mount /dev/da1s1 /iscsi
You may also need to update /etc/fstab file:
/dev/ad1s1 /iscsi ufs rw 3 3



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

郑重说明:
中国成天叫嚣“中华民族的伟大复兴”,“教育兴国”,“教育是根本”……,但政府教育经费投入之少与非洲穷国乌干达看齐,百姓自掏教育经费之多全球之冠!此谓社会主义优越性
空间积分可以换礼品了! | 有奖跟帖:服务器节能,奖50-100元图书 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
版主 剑心通明 (【涉水吟天问,扬天唱广陵】)
版主-老法王



UID:214278
注册:2005-1-10
最后登录: 2008-09-05
帖子:23427
精华:42

可用积分:13052 (大富大贵)
信誉积分:105
空间积分:845 (稍有积蓄)
专家积分:11 (本版)

状态:...保密...

[个人空间] [短信] [博客]


顶部
2楼 发表于 2008-6-30 15:09 
这个或许能用上,呵呵



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

疑难杂症期待高手亮剑>>>
BSD爱好者乐园(www.bsdlover.cn)-BSD精华文章收藏基地,欢迎查阅!
空间积分可以换礼品了! | 有奖跟帖:服务器节能,奖50-100元图书 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
zhangweizj   帅哥
光明使者




UID:234680
注册:2005-3-7
最后登录: 2008-09-05
帖子:726
精华:0

可用积分:530 (稍有积蓄)
信誉积分:100
空间积分:0 (白手起家)
专家积分:0 (本版)

状态:...离线...

[个人空间] [短信] [博客]


顶部
3楼 发表于 2008-6-30 15:43 
不错,一直用的都是 ports里的那个iscsi,看来FB自带的工具功能要强大许多



您对本贴的看法:鲜花[0] 臭蛋[0]
空间积分可以换礼品了! | 有奖跟帖:服务器节能,奖50-100元图书 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
badb0y   帅哥
大天使




UID:33926
注册:2002-12-12
最后登录: 2008-09-05
帖子:2117
精华:3

可用积分:2215 (小富即安)
信誉积分:100
空间积分:0 (白手起家)
专家积分:0 (本版)

状态:...在线...

[个人空间] [短信] [博客]


顶部
4楼 发表于 2008-6-30 17:14 
现在一直在用operfiler,,这相软件ISCSI,



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

俺的blog:http://badb0y.cublog.cn
Easy-CDN:免费提供CDN解决方案
AutoSetup:提供LINUX下自动安装程序
空间积分可以换礼品了! | 有奖跟帖:服务器节能,奖50-100元图书 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘
suek   帅哥
光明使者



UID:36756
注册:2002-12-28
最后登录: 2008-08-11
帖子:768
精华:0

可用积分:767 (稍有积蓄)
信誉积分:100
空间积分:0 (白手起家)
专家积分:0 (本版)

状态:...离线...

[个人空间] [短信] [博客]


顶部
5楼 发表于 2008-7-1 17:42 
很好。



您对本贴的看法:鲜花[0] 臭蛋[0]

__________________________________

空中的鱼
空间积分可以换礼品了! | 有奖跟帖:服务器节能,奖50-100元图书 | 致电800-858-2903,了解DELL如何为你量身订制笔记本 | 送2G U盘

首页 » 论坛 » BSD »


 


Copyright © 2001-2008 ChinaUnix.net All Rights Reserved     联系我们:

感谢所有关心和支持过ChinaUnix的朋友们    转载本站内容请注明原作者名及出处

京ICP证041476号


清除 Cookies - ChinaUnix - Archiver - WAP - TOP

Processed in 0.123866 second(s), 4 queries , Gzip enabled