注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

從頭再來 Blog

一切將會如小生命的誕生一樣,從頭再來.....

 
 
 

日志

 
 

ubuntu 加入 ISCSI 磁盘分区  

2013-04-17 17:20:16|  分类: Ubuntu |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
[1] Configure iSCSI Initiator
root@www:~#aptitude -y install open-iscsi
root@www:~#vi /etc/iscsi/iscsid.conf
# line 39: uncomment

node.session.auth.authmethod = CHAP
# line 43,44: uncomment and set username and password which set on iSCSI Target

node.session.auth.username =username
node.session.auth.password =password
# discover target

root@www:~#iscsiadm -m discovery -t sendtargets -p 10.0.0.30
10.0.0.30:3260,1 iqn.2012-07.world.server:target0
# confirm status after discovery

root@www:~#iscsiadm -m node -o show
# BEGIN RECORD 2.0-871 node.name = iqn.2012-07.world.server:target0
node.tpgt = 1
node.startup = manual
iface.hwaddress = <empty>
iface.ipaddress = <empty>
iface.iscsi_ifacename = default
iface.net_ifacename = <empty>
iface.transport_name = tcp
iface.initiatorname = <empty>
node.discovery_address = 10.0.0.30
node.discovery_port = 3260
node.discovery_type = send_targets
node.session.initial_cmdsn = 0
node.session.initial_login_retry_max = 8
node.session.xmit_thread_priority = -20
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.auth.authmethod = CHAP
node.session.auth.username = username
node.session.auth.password = ********
node.session.auth.username_in = <empty>
node.session.auth.password_in = <empty>
node.session.timeo.replacement_timeout = 120
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 20
node.session.err_timeo.host_reset_timeout = 60
node.session.iscsi.FastAbort = Yes
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.session.iscsi.DefaultTime2Retain = 0
node.session.iscsi.DefaultTime2Wait = 2
node.session.iscsi.MaxConnections = 1
node.session.iscsi.MaxOutstandingR2T = 1
node.session.iscsi.ERL = 0
node.conn[0].address = 10.0.0.30
node.conn[0].port = 3260
node.conn[0].startup = manual
node.conn[0].tcp.window_size = 524288
node.conn[0].tcp.type_of_service = 0
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.auth_timeout = 45
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
node.conn[0].iscsi.HeaderDigest = None
node.conn[0].iscsi.DataDigest = None
node.conn[0].iscsi.IFMarker = No
node.conn[0].iscsi.OFMarker = No
# END RECORD
# login to target

root@www:~#iscsiadm -m node --login
Logging in to [iface: default, target: iqn.2012-07.world.server:target0, portal: 10.0.0.30,3260]
Login to [iface: default, target: iqn.2012-07.world.server:target0, portal: 10.0.0.30,3260]: successful
# confirm session

root@www:~#iscsiadm -m session -o show
tcp: [1] 10.0.0.30:3260,1 iqn.2012-07.world.server:target0
# confirm partitions

root@www:~#cat /proc/partitions
major   minor   #blocks         name
8          0         31457280     sda
8          1         512000         sda1
8          2         30944256     sda2
253      0         20971520     dm-0
253      1         6160384       dm-1
253      2         3809280       dm-2
8          16       104857600   sdb
# added new device provided from target



[2] Configure iSCSI Target
root@dlp:~#pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
# create a volume group named "vg_target00"

root@dlp:~#vgcreate -s 32M vg_target00 /dev/sdb1
  Volume group "vg_target00" successfully created

# create a logical volume named "lv_target00"
root@dlp:~#lvcreate -L 100G -n lv_target00 vg_target00
  Logical volume "lv_target00" created
root@dlp:~#aptitude -y install iscsitarget iscsitarget-dkms
root@dlp:~#vi /etc/default/iscsitarget
# change

ISCSITARGET_ENABLE=true
root@dlp:~#vi /etc/iet/ietd.conf
# add at the last

# naming rule : [ iqn.yaer-month.domain:any name ]
   Target iqn.2012-07.world.server:target0
   
# provided devicce as a iSCSI target
    Lun 0 Path=/dev/vg_target00/lv_target00,Type=blockio
   
# iSCSI Initiator's IP address you allow to connect
    initiator-address 10.0.0.31
   
# authentication info ( set anyone you like for "username", "password" )
    incominguser username password

root@dlp:~#service iscsitarget restart
* Removing iSCSI enterprise target devices:
...done.
* Stopping iSCSI enterprise target service:
...done.
* Removing iSCSI enterprise target modules:
...done.
* Starting iSCSI enterprise target service
...done.
...done.
root@dlp:~#chkconfig tgtd on
root@dlp:~#ietadm --op show --tid=1
# confirm status

Wthreads=8
Type=0
QueuedCommands=32
NOPInterval=0
NOPTimeout=0
  评论这张
 
阅读(606)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017