Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howtos:network_services:iscsi [2019/11/09 01:08 (UTC)]
bifferos [Configuration]
howtos:network_services:iscsi [2019/12/01 01:25 (UTC)]
bifferos
Line 42: Line 42:
 The kernel modules are also loaded automatically by Slackware-current. ​ open-iscsi SlackBuild on SBO has been recently fixed, so should install with slpkg -s sbo open-isci. The kernel modules are also loaded automatically by Slackware-current. ​ open-iscsi SlackBuild on SBO has been recently fixed, so should install with slpkg -s sbo open-isci.
  
-==== Configuration ====+==== Target ​Configuration ====
  
-First, get the initiator ID from the client:+First, get the initiator ID from the initiator (client):
 <​code>​ <​code>​
 # cat /​etc/​iscsi/​initiatorname.iscsi ​ # cat /​etc/​iscsi/​initiatorname.iscsi ​
 </​code>​ </​code>​
  
-Then on the server+Mine looks like this: 
 +<​code>​ 
 +InitiatorName=iqn.2005-03.org.open-iscsi:​91871cf5e261 
 +</​code>​ 
 + 
 +It will be important later. 
 + 
 +Next we need to configure our target (that'​s ​the 'server' remember?​). ​ In order to do this we use something called target-cli, so get targetcli-fb from Slackbuilds and install it: 
 + 
 +<​code>​ 
 +slpkg -s sbo targetcli-fb 
 +</​code>​ 
 + 
 +Targetcli requires a directory to store its data, make sure it exists:
  
 <​code>​ <​code>​
 # mkdir /etc/target # mkdir /etc/target
 </​code>​ </​code>​
 +
 +targetcli is a bit like a command-line directory browser except you use it to change values in a hierarchical store. That same hierarchy also contains the commands you invoke to make changes, however. ​ You've probably not seen anything like it before and it's best just described by example.
 +
 +Start by launching targetcli
 +
 +<​code>​
 +# targetcli
 +targetcli shell version 2.1.51
 +Copyright 2011-2013 by Datera, Inc and others.
 +For help on commands, type '​help'​.
 +
 +/>
 +</​code>​
 +
 +Assuming you have a spare (unused) disk, you can now create a block device, e.g.:
 +
 +<​code>​
 +/> backstores/​block create name=myblockdevice dev=/​dev/​sdb
 +Created block storage object block using /dev/sdb.
 +</​code>​
 +
 +Next move to the iscsi target creation step.  Just type create and allow the target to be given a generated name, it's good enough for our purposes. ​ You can give your own name if you want but I saw little point for my setup.
 +
 +<​code>​
 +/> iscsi/
 +/iscsi> create
 +created target iqn.2003-01.org.linux-iscsi.iscsi-server.x8664:​sn.7f83425fbbe8
 +Created TPG 1.
 +Global pref auto_add_default_portal=true
 +Created default portal listening on all IPs (0.0.0.0), port 3260
 +</​code>​
 +
 +Next create LUN for the created target. Type the name of the target/tpg1 to move to the configuration area:
 +
 +<​code>​
 +/iscsi> iqn.2003-01.org.linux-iscsi.iscsi-server.x8664:​sn.7f83425fbbe8/​tpg1
 +</​code>​
 +
 +Then configure it:
 +
 +<​code>​
 +/​iscsi/​iqn.20....425fbbe8/​tpg1>​ luns/ create /​backstores/​block/​myblockdevice
 +</​code>​
 +
 +Then add an ACL by moving into the acl area and creating an ACL which matches the name of the initiator name that you got from the client:
 +
 +<​code>​
 +/​iscsi/​iqn.20....425fbbe8/​tpg1>​ acls/
 +/​iscsi/​iqn.20....be8/​tpg1/​acls>​ create iqn.2005-03.org.open-iscsi:​91871cf5e261
 +</​code>​
 +
 +Simply exit to save your changes:
 +
 +<​code>​
 +/> exit
 +Global pref auto_save_on_exit=true
 +Last 10 configs saved in /​etc/​target/​backup.
 +Configuration saved to /​etc/​target/​saveconfig.json
 +#
 +</​code>​
 +
 +==== Service Setup ====
  
 TO BE CONTINUED.... TO BE CONTINUED....

In Other Languages
QR Code
QR Code howtos:network_services:iscsi (generated for current page)