8.[root@localhost tgt]# cat /etc/tgt/targets.conf
default-driver iscsi
<target iqn.2012-02.com.example:server.target1>
backing-store /dev/sdb1 #share
backing-store /var/lib/tgtd/virtualization/virtimage.img #share2
write-cache on
</target>
<target zh888.com:server.target2>
backing-store /home/zh888/zh888.img
write-cache on
</target>
9.[root@localhost ~]# tgt-admin --show
Target 1: iqn.2012-02.com.example:server.target1
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 2
Initiator: iqn.1991-05.com.microsoft:-7eec9485
Connection: 1
IP Address: 192.168.xx.xx
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: 21468 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/sdb1
Backing store flags:
LUN: 2
Type: disk
SCSI ID: IET 00010002
SCSI SN: beaf12
Size: 524 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: rdwr
Backing store path: /var/lib/tgtd/virtualization/virtimage.img
Backing store flags:
Account information:
ACL information:
ALL
Target 2: zh888.com:server.target2
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 1
Initiator: iqn.1991-05.com.microsoft-7eec9485
Connection: 1
IP Address: 192.168.xx.xx
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: 1049 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: rdwr
Backing store path: /home/zh888/zh888.img
Backing store flags:
Account information:
ACL information:
ALL
10.客户端xp的连接,输入服务器的ip地址。

11.targets目标如下:

12.磁盘管理就会看到未知磁盘1g

13.初始化zh888.img磁盘1g的磁盘如下:

14.磁盘初始化好未指派状态

15.磁盘格式化好之后属性

16.磁盘管理如下

遇到的问题:刚开始tgtd启动不了原因selinux的原因。
