1.\" $NetBSD: iscsi-initiator.8,v 1.8 2011/02/22 17:15:55 sborrill Exp $ 2.\" 3.\" Copyright � 2007 Alistair Crooks. All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. The name of the author may not be used to endorse or promote 14.\" products derived from this software without specific prior written 15.\" permission. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 18.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 21.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 23.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28.\" 29.Dd February 22, 2011 30.Dt ISCSI-INITIATOR 8 31.Os 32.Sh NAME 33.Nm iscsi-initiator 34.Nd refuse-based iSCSI initiator 35.Sh SYNOPSIS 36.Nm 37.Op Fl 46bcDfVv 38.Op Fl a Ar authentication-type 39.Op Fl d Ar digest-type 40.Op Fl h Ar target-hostname 41.Op Fl p Ar target-port-number 42.Op Fl t Ar target-number 43.Op Fl u Ar username 44.Ar mount_point 45.Sh DESCRIPTION 46The 47.Nm 48utility can be used to access an iSCSI target, such as 49.Xr iscsi-target 8 , 50to access block storage which has been exported. 51Information pertaining to the target is displayed underneath 52the mount point, along with the device corresponding 53to the storage which the target exports. 54.Pp 55The various arguments are as follows: 56.Bl -tag -width Ds 57.It Fl 4 58Use an IPv4 connection to the target. 59.It Fl 6 60Use an IPv6 connection to the target. 61.It Fl a Ar authentication-type 62Use the specified authentication type when communicating with the target. 63The possible values are chap, kerberos, srp or none. 64The default value is none. 65.It Fl b 66Show the storage as a block device. 67.It Fl c 68Show the storage as a character device. 69.It Fl d Ar digest-type 70Use the specified digest type when communicating with the target. 71The possible values are header, data, both, all or none. 72The default value is none. 73.It Fl D 74List the LUNs on the specified target and exit (i.e. do discovery only) 75.It Fl f 76Show the storage as a regular file. 77.It Fl h Ar hostname 78Connect to the iSCSI target running on the host specified as the argument. 79.It Fl p Ar port-number 80Connect to the iSCSI target running on the port specified as the argument. 81The default value is 3260. 82.It Fl t Ar target 83Connect to the number of the iSCSI target running as the argument. 84.It Fl u Ar username 85Use the specified user's credentials when logging in to the iSCSI target. 86There is no default. 87.It Fl V 88Print out the version number and then exit. 89.It Fl v 90Be verbose in operation. 91.El 92.Pp 93The 94.Xr refuse 3 95library is used to provide the file system features. 96.Pp 97The mandatory parameter is the local mount point. 98.Pp 99This iSCSI initiator presents a view of the targets underneath the 100mount point. 101Firstly, it creates a directory tree with the hostname of the target, 102and, in that directory, a virtual directory is created for each 103target name exported by the iSCSI target program. 104Within that virtual target directory, symbolic links exist for 105the hostname (for convenience), 106a textual representation of the IP address, 107the iSCSI target product name, 108the iSCSI target IQN, 109the iSCSI target vendor and version number. 110One other directory entry is presented in the virtual target 111directory, relating to the storage presented by the iSCSI target. 112This can be in the form of a regular file, which is also the 113default, a block device or a character device. 114.Pp 115Please note that the 116.Nm 117utility needs the 118.Dq puffs 119kernel module loaded via 120.Xr modload 8 121to operate. 122.Sh EXAMPLES 123.Bd -literal 124# ./iscsi-initiator -u agc -h iscsi-target0.alistaircrooks.co.uk /mnt 125# ls -al /mnt/target0 126total 576 127drwxr-xr-x 2 agc agc 512 May 11 22:24 . 128drwxr-xr-x 2 agc agc 512 May 11 22:24 .. 129lrw-r--r-- 1 agc agc 39 May 11 22:24 hostname -\*[Gt] iscsi-target0.alistaircrooks.co.uk 130lrw-r--r-- 1 agc agc 14 May 11 22:24 ip -\*[Gt] 172.16.135.130 131lrw-r--r-- 1 agc agc 16 May 11 22:24 product -\*[Gt] NetBSD iSCSI 132-rw-r--r-- 1 agc agc 104857600 May 11 22:24 storage 133lrw-r--r-- 1 agc agc 43 May 11 22:24 targetname -\*[Gt] iqn.1994-04.org.netbsd.iscsi-target:target0 134lrw-r--r-- 1 agc agc 8 May 11 22:24 vendor -\*[Gt] NetBSD 135lrw-r--r-- 1 agc agc 4 May 11 22:24 version -\*[Gt] 0 136# 137.Ed 138.Sh SEE ALSO 139.Xr puffs 3 , 140.Xr refuse 3 , 141.Xr iscsi-target 8 142.Sh HISTORY 143The 144.Nm 145utility first appeared in 146.Nx 6.0 . 147An earlier version called iscsifs was available in 148.Nx 5.0 149in source format only. 150.Sh AUTHORS 151The 152.Nm 153utility was written by 154.An Alistair Crooks 155.Aq agc@NetBSD.org . 156.Sh BUGS 157.Nm 158currently only supports a CHAP challenge length of 16 octets. 159Other initiators support up to 1024 and thus it is expected that most targets 160will also support such lengths. 161This means that CHAP compatibility with other targets apart from 162.Xr iscsi-target 8 163is likely to be poor. 164To workaround this, please use authentication type none by not specifying a 165username with the 166.Fl u 167option. 168