一.在linux下安装启动iscsi target
1.安装启动iscsi服务
[root@wjb10000 ~]# yum -y install targetcli.noarch
2.建立一个目录设置为iscsi设备
[root@wjb10000 ~]# mkdir /iscsi_disks
3.设置target
[root@wjb10000 ~]# targetcli
warning: could not load preferences file /root/.targetcli/prefs.bin.
targetcli shell version 2.1.fb41
copyright 2011-2013 by datera, inc and others.
for help on commands, type 'help'.
/> cd backstores/fileio
/backstores/fileio> create disk01 /iscsi_disks/disk01.img 20g
created fileio disk01 with size 21474836480
/backstores/fileio> cd /iscsi
/iscsi> create iqn.2016-06.wjb.com:storage.target0
created target iqn.2016-06.wjb.com:storage.target0.
created tpg 1.
global pref auto_add_default_portal=true
created default portal listening on all ips (0.0.0.0), port 3260.
/iscsi> cd iqn.2016-06.wjb.com:storage.target0/tpg1/portals/
/iscsi/iqn.20.../tpg1/portals> create 192.168.1.50
using default ip port 3260
could not create networkportal in configfs
/iscsi/iqn.20.../tpg1/portals> delete 0.0.0.0 3260
deleted network portal 0.0.0.0:3260
/iscsi/iqn.20.../tpg1/portals> create 192.