redhat6配置ISCSI

准备一台redhat6的虚拟机,添加两块虚拟硬盘vdb  vdc,容量随意.

关掉防火墙和selinux

[root@storage88 ~]# service iptables stop
[root@storage88 ~]# setenforce 0
[root@storage88 ~]# chkconfig --level 35 iptables off
 

安装scsi-target-utils

[root@storage88 ~]# yum -y install scsi-target-utils

[root@storage88 ~]# cp /etc/tgt/targets.conf  /opt/

修改配置文件,给两块磁盘设置共享存储。

[root@storage88 ~]# vim /etc/tgt/targets.conf

 62 <target iqn.2018-12.cn.tedu:storage88.diskb>
 63     backing-store /dev/vdb
 64     write-cache off
 65     initiator-address 192.168.4.30
 66     initiator-address 192.168.4.40
 67     vendor_id mydiskb
 68     product_id tarena
 69 </target>
 70 
 71 <target iqn.2018-12.cn.tedu:storage88.diskc>
 72      backing-store /dev/vdc
 73      write-cache off
 74      vendor_id mydiskc
 75      product_id tarena
 76 </target>
 

启动服务

[root@storage88 ~]# service tgtd start
[root@storage88 ~]# chkconfig --level 35 tgtd on
[root@storage88 ~]# netstat -untalp |grep :3260
tcp        0      0 0.0.0.0:3260                0.0.0.0:*                   LISTEN      4982/tgtd           
tcp        0      0 :::3260                     :::*                        LISTEN      4982/tgtd 

 

查看共享信息

[root@storage88 ~]# tgt-admin -s

Target 1: iqn.2018-12.cn.tedu:storage88.diskb
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 5369 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/vdb
            Backing store flags: 
    Account information:
    ACL information:
        192.168.4.30
        192.168.4.40
Target 2: iqn.2018-12.cn.tedu:storage88.diskc
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00020000
            SCSI SN: beaf20
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00020001
            SCSI SN: beaf21
            Size: 5369 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/vdc
            Backing store flags: 
    Account information:
    ACL information:
        ALL

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值