Linux iscsi配置

Linux iscsi配置
摘要由CSDN通过智能技术生成

配置 iscsi

1.安装软件

1.yum install -y targetcli
2.systemctl start target
3.systemctl enable target
[root@localhost ~]# yum install -y targetcli
已加载插件:fastestmirror, langpacks

2.利用fdisk命令新增一块硬盘/dev/vdb1,大小为1G

1.fdisk /dev/vdb1 
2.n 	#新建
3.p	#主分区
4.+1G	#指定大小为1G
5.w	#写入
[root@localhost ~]# fdisk /dev/vbd1

3.执行targetcli命令

1.#建立与硬盘的连接
2./backstores/block create octopus:storage1 /dev/vdb1	
3. #创建存储接口
4. iscsi/ create iqn.2019-05.com.octopus:storage1		
5.#创建连接名称		
6. iscsi/iqn.2019-05.com.octopus:storage1/tpg1/luns create 7./backstores/block/octopus:storage1 
8.#添加连接密要
9. iscsi/iqn.2019-05.com.octopus:storage1/tpg1/acls create iqn.2019-05.com.octopus:key1
10. #指定连接IP
11. iscsi/iqn.2019-05.com.octopus:storage1/tpg1/portals create 172.25.254.141
12. #退出命令
 exit
————————————————
[root@localhost ~]# systemctl start target
[root@localhost ~]# systemctl enable target
Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.
[root@localhost ~]# targetcli
targetcli shell version 2.1.fb46
Copyright 2011-2013 by Datera, Inc and others.
For help on commands, type 'help'.

/> 
/> ls
o- / ............................................................................ [...]
  o- backstores ................................................................. [...]
  | o- block ..................................................... [Storage Objects: 0]
  | o- fileio .....
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值