1The NetBSD iSCSI HOWTO
2======================
3
4This document is intended to tell you how to set up an iSCSI target on
5a NetBSD host, so that block storage can be presented to the network. 
6It then goes on to show how to connect to that storage using the
7Microsoft iSCSI initiator (version 1.06, running on Windows XP).
8
9
101. Configuring the NetBSD iSCSI target
11======================================
12
131.1. Decide what storage will be presented
14
15The iSCSI target serves up block storage to clients on the network.
16These clients are called "initiators". Firstly, we must decide how
17much storage we are going to serve up, and for this document, we
18will serve up 100 MB. It will be in a file called /tmp/iscsi-target0.
19
20So we must first edit /etc/iscsi/targets, so that it contains the
21following lines:
22
23	# extent        file or device          start           length
24	extent0         /tmp/iscsi-target0      0               100MB
25
26	# target        flags   storage                 netmask
27	target0         rw      extent0                 0/0
28
29The extent definition tells the file which is used as backing
30store. It is persistent, so that the target can serve up the
31same storage after reboot. Its length is 100 MB, and there is
32no offset into the file for the start of the extent. (An offset
33is useful if you need to skip over MBRs, or disklabels).
34
35The extent is mounted read-write by "target0", and is served up
36to any host (the 0.0.0.0/0 netmask).
37
381.2. Start the iscsi-target
39
40Issue the command:
41
42	# /etc/rc.d/iscsi_target forcestart
43
44and you should see the messages from the iscsi-target:
45
46	Starting iscsi_target.
47	Reading configuration from `/etc/iscsi/targets'
48	target0:rw:0/0
49		extent0:/tmp/iscsi-target0:0:104857600
50	DISK: 1 logical units (204800 blocks, 512 bytes/block), type iscsi fs
51	DISK: LU 0: 100 MB disk storage for "target0"
52	TARGET: TargetName is iqn.1994-04.org.netbsd.iscsi-target
53
541.3 You're done!
55
56Congratulations - your iSCSI target is now up and running and
57serving blocks to initiators.
58
59
60
612. Configuring the Microsoft iSCSI initiator, version 1.06
62==========================================================
63
64Please see the relevant documentation on setting up iSCSI initiators.
65
66Alistair Crooks
67Sun Jan  6 10:38:19 GMT 2008
68