<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ali Aboosaidi &#187; san</title>
	<atom:link href="http://insanelabs.com/tag/san/feed/" rel="self" type="application/rss+xml" />
	<link>http://insanelabs.com</link>
	<description>Umm... Unorthodox?</description>
	<lastBuildDate>Tue, 08 Nov 2011 21:04:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Debian: open-iscsi, use iSCSI initiator to connect to a SAN</title>
		<link>http://insanelabs.com/linux/debian-open-iscsi-use-iscsi-initiator-to-connect-to-a-san/</link>
		<comments>http://insanelabs.com/linux/debian-open-iscsi-use-iscsi-initiator-to-connect-to-a-san/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 20:41:03 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[san]]></category>

		<guid isPermaLink="false">http://insanelabs.com/?p=687</guid>
		<description><![CDATA[It is actually quite easy as long as your kernel is 2.6.16 or newer. Debian supports fibre channel out of the box, and for iSCSI you only need to install the open-iscsi package (you can easily taylor this to your distro): aptitude install open-iscsi Once the package is installed restart the initiator: /etc/init.d/open-iscsi restart To [...]
Related posts:<ol>
<li><a href="http://insanelabs.com/debian/linux-debian-etch-x64-and-vmware-server-cannot-connect-to-host-xxxx-no-connection-could-be-made-because-the-target-machine-actively-refused-it/" rel='bookmark' title='Debian: Etch x64 and VMware Server Cannot connect to host x.x.x.x: No connection could be made because the target machine actively refused it.' class="liinternal">Debian: Etch x64 and VMware Server Cannot connect to host x.x.x.x: No connection could be made because the target machine actively refused it.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It is actually quite easy as long as your kernel is 2.6.16 or newer. Debian supports fibre channel out of the box, and for iSCSI you only need to install the open-iscsi package (you can easily taylor this to your distro):</p>
<pre>aptitude install open-iscsi</pre>
<p>Once the package is installed restart the initiator:</p>
<pre>/etc/init.d/open-iscsi restart</pre>
<p>To find out the indentifier name take a look at initiatorname.iscsi file:</p>
<pre>cat /etc/iscsi/initiatorname.iscsi</pre>
<p>You can find the initiator identifier towards the bottom of the file&#8230; mine is InitiatorName=iqn.1993-08.org.debian:01:61ddbbf82a70. Once you found the name you should be able to discover the target with the following command (my LeftHandNetworks iSCSI SAN IP is 192.168.1.70):</p>
<pre>iscsiadm -m discovery -t sendtargets -p 192.168.1.70</pre>
<p>Make a note of the record ID (mine is iqn.2003-10.com.lefthandnetworks:sancrp:3139:debian) and connect to it using the following command:</p>
<pre>iscsiadm --mode node --targetname iqn.2003-10.com.lefthandnetworks:sancrp:3139:debian --portal 192.168.1.70:3260 --login</pre>
<p>Once you initiated the command your iSCSI target will become visible to the OS as an SCSI disk (/dev/sda). You can now partition, format and then mount the LUN just like any other storage device. Add the target to your fstab and it should be auto-mounted everytime your system boots.</p>
<pre>nano /etc/fstab</pre>
<p>and add:</p>
<pre>/dev/sda1   /iscsi   ext3   _netdev   0   0</pre>
<p>To have the LUN mounted to /iscsi directory. It didn&#8217;t work that well in my case&#8230; fstab mounts devices early during startup and before iscsi init, and OS couldn&#8217;t find the target to mount. I ended up scripting the initiator and mount&#8230; created a file &#8220;initiscsi&#8221; in /etc/init.d directory and added the following lines:</p>
<pre>iscsiadm --mode node --targetname iqn.2003-10.com.lefthandnetworks:sancrp:3139:debian --portal 192.168.1.70:3260 --login
sleep 5
mount -t ext3 /dev/sda1 /iscsi</pre>
<p>I&#8217;m sure there is a proper way to have the session initiated before the mount, but I didn&#8217;t care enough to figure it out. Init and mount script will do just fine in my case since my LUN is just a storage device.</p>
<p>That sleep command is to make sure the LUN is visible to the OS before it&#8217;s mounted. I added the script to my startup sequence after making it executable:</p>
<pre>chmod +x initiscsi
update-rc.d initiscsi defaults</pre>
<p>This is of course for Debian startup.</p>
<p>If you are using CHAP you will need to edit your iscsid.conf file:</p>
<pre>nano /etc/iscsi/iscsid.conf</pre>
<p>and update it with correct authentication info:</p>
<pre>node.startup = automatic
node.session.auth.username = username
node.session.auth.password = password
discovery.sendtargets.auth.username = username
discovery.sendtargets.auth.password = password</pre>
<p>Save and close the file, then initiate discovery.</p>
<p>Added by Tim Rogers (thanks!):</p>
<p>If you wish to do this properly, you must change the boot order so that the disks are available when the iscsiadm daemon starts. To do this</p>
<pre>mv /etc/rcS.d/S25open-iscsi /etc/rcS.d/S88open-iscsi</pre>
<p>Check the etc/rcsS.d file first to check when open-iscsi is initiated. May have to change the command to relate to your particular setup. Then there is no need to set up the initiscsi file as described above if this is done.</p>
<p>Related posts:<ol>
<li><a href="http://insanelabs.com/debian/linux-debian-etch-x64-and-vmware-server-cannot-connect-to-host-xxxx-no-connection-could-be-made-because-the-target-machine-actively-refused-it/" rel='bookmark' title='Debian: Etch x64 and VMware Server Cannot connect to host x.x.x.x: No connection could be made because the target machine actively refused it.' class="liinternal">Debian: Etch x64 and VMware Server Cannot connect to host x.x.x.x: No connection could be made because the target machine actively refused it.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://insanelabs.com/linux/debian-open-iscsi-use-iscsi-initiator-to-connect-to-a-san/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

