<?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>iscsi target on centos 8 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/iscsi-target-on-centos-8/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 20 Nov 2019 19:34:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How To Configure iSCSI Target and Initiator on CentOS 8 /RHEL 8</title>
		<link>https://www.osradar.com/how-to-configure-iscsi-target-and-initiator-on-centos-8-rhel-8/</link>
					<comments>https://www.osradar.com/how-to-configure-iscsi-target-and-initiator-on-centos-8-rhel-8/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Wed, 20 Nov 2019 19:34:07 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Centos 8]]></category>
		<category><![CDATA[install iscsi centos 8]]></category>
		<category><![CDATA[install iscsi on rhel 8]]></category>
		<category><![CDATA[iscsi target on centos 8]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[unix]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=15619</guid>

					<description><![CDATA[<p>In this tutorial, we are going to configure iSCSI Target &#38; Initiator on CentOS 8 / RHEL 8 using single server as Target &#38; Initiator as shown in figure. Step 1: Update your System Type this command to update your system. sudo dnf update Step 2: SELinux is in Enforcing Mode Make sure your SELinux [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-iscsi-target-and-initiator-on-centos-8-rhel-8/">How To Configure iSCSI Target and Initiator on CentOS 8 /RHEL 8</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this tutorial, we are going to configure iSCSI Target &amp; Initiator on CentOS 8 / RHEL 8 using single server as Target &amp; Initiator as shown in figure.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="1024" height="731" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/iscsi-step-1-1024x731.jpg" alt="" class="wp-image-15756" srcset="https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-1024x731.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-300x214.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-768x549.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-100x70.jpg 100w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-696x497.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-1068x763.jpg 1068w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-588x420.jpg 588w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-step-1-1920x1371.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure></div>



<h3><strong>Step 1: Update your System</strong></h3>



<p>Type this command to update your system.</p>



<pre class="wp-block-verse">sudo dnf update</pre>



<h3><strong>Step 2: SELinux is in Enforcing Mode</strong></h3>



<p>Make sure your SELinux status is working.</p>



<pre class="wp-block-verse">getenforce</pre>



<p>As it will cover configuration of SELinux, make sure it is running in enforcing mode.</p>



<h3><strong>Step 3: Install Targetcli on CentOS / RHEL 8</strong></h3>



<p>The package for iSCSI Target is available as targetcli on your CentOS / RHEL 8 default AppStrean repositories. You can isnstall it by runnign following command.</p>



<pre class="wp-block-verse">sudo dnf -y install targetcli</pre>



<h3><strong>Step 4: Check available space on your system</strong></h3>



<p>Before proceeding further make sure you&#8217;ve enough space available for allocation. It is recommended to set a different partition for easier way to manage without interfering with the core CentOS files and system.</p>



<pre class="wp-block-verse">df -hT</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="738" height="502" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/df-hT-command.png" alt="" class="wp-image-15757" srcset="https://www.osradar.com/wp-content/uploads/2019/11/df-hT-command.png 738w, https://www.osradar.com/wp-content/uploads/2019/11/df-hT-command-300x204.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/df-hT-command-696x473.png 696w, https://www.osradar.com/wp-content/uploads/2019/11/df-hT-command-617x420.png 617w" sizes="(max-width: 738px) 100vw, 738px" /></figure></div>



<p>It would be more easy if you&#8217;ve a secondary disk on the server so use it if you&#8217;ve.</p>



<h3><strong>Step 5: Configure iSCSI Target on CentOS / RHEL 8.</strong></h3>



<p>Create a directory in your configured disks e.g; in <strong>/var/</strong> or a mount point for your secondary disk, or a raid device.</p>



<pre class="wp-block-verse">sudo mkdir /var/targetdisk01</pre>



<p>Now move towards to create our targets through targetcli admin console.</p>



<pre class="wp-block-verse">sudo su -<br>targetcli</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="432" height="127" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/targetcli.png" alt="" class="wp-image-15758" srcset="https://www.osradar.com/wp-content/uploads/2019/11/targetcli.png 432w, https://www.osradar.com/wp-content/uploads/2019/11/targetcli-300x88.png 300w" sizes="(max-width: 432px) 100vw, 432px" /></figure></div>



<p>List its contents to look over.</p>



<pre class="wp-block-verse">ls</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="432" height="127" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/targetcli-1.png" alt="" class="wp-image-15759" srcset="https://www.osradar.com/wp-content/uploads/2019/11/targetcli-1.png 432w, https://www.osradar.com/wp-content/uploads/2019/11/targetcli-1-300x88.png 300w" sizes="(max-width: 432px) 100vw, 432px" /></figure></div>



<p>After listing you will see that everything is empty. You will notice that the first thing in the content is the back-stores. </p>



<h6><strong>What are Backstores?</strong></h6>



<p>Backstores are for the purpose of providing different ways of  keeping data locally that can be later exported or made available to an external system such as an initiator. The available options for backstores are block, fileio,pscsi, and ramdisk.</p>



<p>Block backstore can be a Linux block device like hard drive. If you&#8217;ve disk in your target you can use this option. Fileio refered to a normal file on the file system that has been created with a predefined size. We will use this option in our set up. Genearally, a block backstore performs better than a single file.</p>



<h3><strong>Create a fileio backstore of 5GB.</strong></h3>



<p>Change path to <strong>backstores/fileio</strong> while on the targetcli console and create the backstore.</p>



<pre class="wp-block-verse">cd backstores/fileio</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="597" height="72" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/fileio.png" alt="" class="wp-image-15760" srcset="https://www.osradar.com/wp-content/uploads/2019/11/fileio.png 597w, https://www.osradar.com/wp-content/uploads/2019/11/fileio-300x36.png 300w" sizes="(max-width: 597px) 100vw, 597px" /></figure></div>



<p>Make sure it is created by listing the content.</p>



<pre class="wp-block-verse">ls</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="730" height="118" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/ls-fileio.png" alt="" class="wp-image-15761" srcset="https://www.osradar.com/wp-content/uploads/2019/11/ls-fileio.png 730w, https://www.osradar.com/wp-content/uploads/2019/11/ls-fileio-300x48.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/ls-fileio-696x113.png 696w" sizes="(max-width: 730px) 100vw, 730px" /></figure></div>



<h3><strong>Create the iSCSI Target</strong></h3>



<p>Move to the iSCSI path in your server for creating the iSCSI Target.</p>



<pre class="wp-block-verse">cd /iscsi</pre>



<p>As we are now inside iscsi path so it is possible to create the iscsi target with a name. The naming convention is standard and be like this.</p>



<pre class="wp-block-verse">[ iqn.(year)-(month).(reverse of domain name):(Your favourite name) ].</pre>



<p>Our domain is osradar.com, the reverse of it will be the com.osradar. You can select your desired domain according to this method. So, let&#8217;s create our first target.</p>



<pre class="wp-block-verse">create iqn.2019.11.osradar.com:iSCSITarget1</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="667" height="100" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/create-target.png" alt="" class="wp-image-15762" srcset="https://www.osradar.com/wp-content/uploads/2019/11/create-target.png 667w, https://www.osradar.com/wp-content/uploads/2019/11/create-target-300x45.png 300w" sizes="(max-width: 667px) 100vw, 667px" /></figure></div>



<p>Have a look at the changes by typing ls command.</p>



<pre class="wp-block-verse">ls</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="723" height="159" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/ls-target.png" alt="" class="wp-image-15763" srcset="https://www.osradar.com/wp-content/uploads/2019/11/ls-target.png 723w, https://www.osradar.com/wp-content/uploads/2019/11/ls-target-300x66.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/ls-target-696x153.png 696w" sizes="(max-width: 723px) 100vw, 723px" /></figure></div>



<h4><strong>Create a LUN</strong></h4>



<p>LUN is a logical unit of storage. A target can offer one or more LUNs to the iSCSI clients, who initiates a connection with the iSCSI server. Navigate to the option target portal group (TPG) we created earlier in the previous command. Notice &#8220;Created TPG 1&#8221; from above.</p>



<pre class="wp-block-verse">cd iqn.2019-11.osradar.com:target01/tpg1/luns</pre>



<p>Now create the LUN from the targetdisk1. Use your selected disk.</p>



<pre class="wp-block-verse">create /backstores/fileio/targetdisk1</pre>



<p>List content to verify.</p>



<pre class="wp-block-verse">ls</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="726" height="101" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/LUN-creation.png" alt="" class="wp-image-15765" srcset="https://www.osradar.com/wp-content/uploads/2019/11/LUN-creation.png 726w, https://www.osradar.com/wp-content/uploads/2019/11/LUN-creation-300x42.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/LUN-creation-696x97.png 696w" sizes="(max-width: 726px) 100vw, 726px" /></figure></div>



<h4><strong>Configur Access Control List (ACL)</strong></h4>



<p>ACL is used to connect only known initiators to our Target. Go to file <strong>/etc/iscsi/iniatorname.iscsi </strong>file on the client/initiator and check the name of initiator. You can use your own according to your requirements.</p>



<pre class="wp-block-verse">sudo vi /etc/iscsi/initiatorname.iscsi</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="614" height="100" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/acl.png" alt="" class="wp-image-15766" srcset="https://www.osradar.com/wp-content/uploads/2019/11/acl.png 614w, https://www.osradar.com/wp-content/uploads/2019/11/acl-300x49.png 300w" sizes="(max-width: 614px) 100vw, 614px" /></figure></div>



<p>While staying on the same path as above navigate to acls</p>



<pre class="wp-block-verse">cd acls</pre>



<p>Now run the following command with the iqn of the initiator in the acls path.</p>



<pre class="wp-block-verse">create iqn.2019-11.com.osradar:initiator1</pre>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="681" height="76" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/acls-creation.png" alt="" class="wp-image-15767" srcset="https://www.osradar.com/wp-content/uploads/2019/11/acls-creation.png 681w, https://www.osradar.com/wp-content/uploads/2019/11/acls-creation-300x33.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></figure></div>



<h3><strong>Set up Credential details</strong></h3>



<p>Set up username and password to authenticate the initiator while it sends a request to the target.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="721" height="141" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/credential-details.png" alt="" class="wp-image-15768" srcset="https://www.osradar.com/wp-content/uploads/2019/11/credential-details.png 721w, https://www.osradar.com/wp-content/uploads/2019/11/credential-details-300x59.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/credential-details-696x136.png 696w" sizes="(max-width: 721px) 100vw, 721px" /></figure></div>



<p>Make sure your settings are properly done by navigating to /iscsi and then save it by exiting.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="733" height="227" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/iscsi-final.png" alt="" class="wp-image-15769" srcset="https://www.osradar.com/wp-content/uploads/2019/11/iscsi-final.png 733w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-final-300x93.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/iscsi-final-696x216.png 696w" sizes="(max-width: 733px) 100vw, 733px" /></figure></div>



<p>Enable the target and allow firewall rules.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" width="740" height="277" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2019/11/relaod-.png" alt="" class="wp-image-15770" srcset="https://www.osradar.com/wp-content/uploads/2019/11/relaod-.png 740w, https://www.osradar.com/wp-content/uploads/2019/11/relaod--300x112.png 300w, https://www.osradar.com/wp-content/uploads/2019/11/relaod--696x261.png 696w" sizes="(max-width: 740px) 100vw, 740px" /></figure></div>



<h3><strong>Step 6: Configure iSCSI Initiator</strong></h3>



<p>We have all done except configuring our initiator. Follow our following tutorial to learn configuring iSCSI initiator.</p>



<p><a href="https://www.osradar.com/how-to-configure-iscsi-initiator-on-centos-rhel-8/" target="_blank" rel="noreferrer noopener" aria-label="How To Configure iSCSI Initiator on CentOS / RHEL 8. (opens in a new tab)">How To Configure iSCSI Initiator on CentOS / RHEL 8.</a></p>



<p>Congratulations! You&#8217;ve all done if have any queries regarding this tutorial leave a comment.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-configure-iscsi-target-and-initiator-on-centos-8-rhel-8/">How To Configure iSCSI Target and Initiator on CentOS 8 /RHEL 8</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-configure-iscsi-target-and-initiator-on-centos-8-rhel-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
