iscsi
服务器端设置
安装target包
yum install scsi-target-utils.x86_64
创建测试裸磁盘
dd if=/dev/zero of=/iSCSIdisk/200M.img bs=1M seek=200 count=0
dd if=/dev/zero of=/iSCSIdisk/300M.img bs=1M seek=300 count=0
编辑target文件
vim /etc/tgt/targets.conf
<targetiqn.2016-08.disk.rh6:disk200m>
backing-store /iSCSIdisk/200M.img
initiator-address 192.168.211.1
</target>
<targetiqn.2016-08.disk.rh6:disk300m>
backing-store /iSCSIdisk/300M.img
initiator-address 192.168.211.128
</target>
启动服务
service tgtd start
查看映射信息
tgt-admin -show
Linux client端安装包
yum install iscsi-initiator-utils.x86_64
查找iqn
iscsiadm -m discovery -t sendtargets -p 192.168.211.128
映射挂载裸磁盘
iscsiadm -m node -T iqn.2004-01.com.storbridge:block02-wt -p 192.16.10.188:3260 -l
开启自动映射裸磁盘
iscsiadm -m node -T iqn.2004-01.com.storbridge:block02-wt -p 192.16.10.188:3260 --op update -n node.startup -v automatic
目录下存放的是所有iscsi挂载的iqn
/var/lib/iscsi/nodes
目录下存放的是iscsi挂载存储IP
/var/lib/iscsi/sendtargets
查找
iscsiadm -m node
登录
iscsiadm -m node -T iqn.2016-08.disk.rh6:disk300m --login