<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paulmaxson</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Paulmaxson"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Paulmaxson"/>
	<updated>2026-04-27T01:43:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_iSCSI&amp;diff=22803</id>
		<title>Setting up iSCSI</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_iSCSI&amp;diff=22803"/>
		<updated>2022-12-24T07:47:36Z</updated>

		<summary type="html">&lt;p&gt;Paulmaxson: Typos and grammar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tip|Consider using [[Linux_iSCSI_Target_(TCM)|TCM]] instead of iscsitarget}}&lt;br /&gt;
&lt;br /&gt;
iSCSI consists of two components:  A target (server) and an initiator (client).  A target is a large pool of disk space that can be accessed over IP by the initiators. Initiators use the disk space, formatting it and mounting it the same as local disk.  When an initiator connects to a target, a SCSI device node is created (e.g. /dev/sda, /dev/sdb, etc).&lt;br /&gt;
&lt;br /&gt;
= iSCSI Target =&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;iscsitarget-X.X.apk&#039;&#039; package provides the target functionality.  It includes the ietd service (ietd is the iSCSI Enterprise Target Daemon). The &#039;&#039;iscitarget-grsec&#039;&#039; package includes the kernel drivers for the &#039;&#039;grsec&#039;&#039; flavor of linux kernel.&lt;br /&gt;
Install with:&lt;br /&gt;
{{Cmd|apk add iscsitarget iscsitarget-grsec}}&lt;br /&gt;
Once the packages are [[Alpine_package_management#Add_a_Package|installed]], you can set up a target by editing two conf files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In /etc/ietd.conf, add the following information:&lt;br /&gt;
&lt;br /&gt;
        Target iqn.2006-01.com.example:disk2.vol1&lt;br /&gt;
               Lun 0 Path=/dev/sda1, Type=fileio&lt;br /&gt;
&lt;br /&gt;
The iSCSI Qualified Name is documented in [http://www.ietf.org/rfc/rfc3720.txt  RFC 3720], with further examples of names in [http://www.ietf.org/rfc/rfc3721.txt RFC 3721]. Briefly, the fields are:&lt;br /&gt;
&lt;br /&gt;
* literal &#039;&#039;&#039;iqn&#039;&#039;&#039;&lt;br /&gt;
* date (yyyy-mm) that the naming authority took ownership of the domain&lt;br /&gt;
* reversed domain name of the authority (&#039;&#039;org.alpinelinux, com.example, to.yp.cr&#039;&#039;) &lt;br /&gt;
* Optional &amp;quot;:&amp;quot; prefixing a storage target name specified by the naming authority.&lt;br /&gt;
&lt;br /&gt;
From the RFC:&lt;br /&gt;
                    Naming     String defined by&lt;br /&gt;
       Type  Date    Auth      &amp;quot;example.com&amp;quot; naming authority&lt;br /&gt;
      +--++-----+ +---------+ +--------------------------------+&lt;br /&gt;
      |  ||     | |         | |                                |     &lt;br /&gt;
 &lt;br /&gt;
      iqn.2001-04.com.example:storage:diskarrays-sn-a8675309&lt;br /&gt;
      iqn.2001-04.com.example&lt;br /&gt;
      iqn.2001-04.com.example:storage.tape1.sys1.xyz&lt;br /&gt;
      iqn.2001-04.com.example:storage.disk2.sys1.xyz&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Target&amp;quot; line above is an example.  This line really just needs to be unique.  /dev/sdx refers to the disk and partition that will be presented to the initiator.  &lt;br /&gt;
&lt;br /&gt;
In the /etc/initiators.allow file, add the following line:&lt;br /&gt;
&lt;br /&gt;
 iqn.2006-01.com.example:disk2.vol1 10.1.194.111&lt;br /&gt;
&lt;br /&gt;
The IP address in the line above will be the initiator&#039;s ip address.  Now only this ip address is allowed to access this specific target.  You must use IP addresses, not hostnames.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t care where the initiator is connecting from, you can use the keyword &#039;&#039;&#039;ALL&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 iqn.2006-01.com.example:disk2.vol1 ALL&lt;br /&gt;
&lt;br /&gt;
= iSCSI Initiator =&lt;br /&gt;
&lt;br /&gt;
{{Warning|1=Please note that Open-iSCSI is broken on Alpine 2.2. See http://groups.google.com/group/open-iscsi/browse_thread/thread/156e938d21f01275#. It works on Alpine 2.1, 2.3 and 2.4 instead.}}&lt;br /&gt;
&lt;br /&gt;
The initiator is in the &#039;&#039;open-iscsi&#039;&#039; package.  Load this package on the client.&lt;br /&gt;
&lt;br /&gt;
To configure the iSCSI initiator, add the initiator name to the file /etc/iscsi/initiatorname.iscsi   The initiator name follows the same iqn naming scheme as the target, but this is identifing the initiator (client).&lt;br /&gt;
&lt;br /&gt;
 InitiatorName=iqn.2007-11.org.alpinelinux.client:01&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
 InitiatorName=iqn.2007-11.com.example.me:foo:bar:baz&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;01&#039;&#039;, &#039;&#039;foo:bar:baz&#039;&#039; are arbitrary.  You can enter anything (or nothing)- as long as the intiator name is a valid iqn.&lt;br /&gt;
&lt;br /&gt;
Start the initiator daemon with&lt;br /&gt;
{{Cmd|/etc/init.d/iscsid start}}&lt;br /&gt;
&lt;br /&gt;
= Connecting the Initiator to the Target =&lt;br /&gt;
&lt;br /&gt;
From the iSCSI initiator, first run this command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|iscsiadm --mode discovery --type sendtargets --portal IP_OF_TARGET}}&lt;br /&gt;
&lt;br /&gt;
This command contacts the target to determine which disks are available.  If all is configured correctly, the target name iqn.2006-01.com.example:disk2.vol1 (from the example above) will be returned.&lt;br /&gt;
&lt;br /&gt;
After the target is discovered, run this command to connect:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|iscsiadm --mode node --targetname NAME_OF_TARGET --portal IP_OF_TARGET --login}}&lt;br /&gt;
&lt;br /&gt;
Replacing --login with --logout will end the connection.  &lt;br /&gt;
&lt;br /&gt;
To make this connection persistent (so that it will reconnect after reboot), run this command:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|iscsiadm -m node -T NAME_OF_TARGET -p IP_OF_TARGET --op update -n node.conn[0].startup -v automatic}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Any references/links to where to find more details about it?&#039;&#039;--[[User:Ncopa|Ncopa]] 16:04, 8 November 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Storage]]&lt;/div&gt;</summary>
		<author><name>Paulmaxson</name></author>
	</entry>
</feed>