This is an old revision of the document!
Table of Contents
iSCSI
You may have heard of iSCSI in the context of corporate SANs perhaps supplying storage to a VMWare cluster of hosts, or some other heavy-weight application. These systems would generally involve running iSCSI over specialist 10Gbe (or more?) hardware and cabling and allow the operators to divorce the supply of storage from the hosts that use it. If that's your interest then this guide is probably not for you.
This guide is for people wanting to make use of iSCSI to share a DISK on a network between two machines. There are a number of reasons why you might want to do this instead of resorting to the probably more familiar file sharing mechanisms such as Samba and NFS but I can immediately think of one: You want the flexibility of a disk that's available on the network, without all the hassle of dealing with the edge cases that the big two file share protocols (CIFS/NFS) introduce. Since it's a SCSI-command (block level) protocol here are some common problems that will simply disappear with iSCSI:
- UID/GID mismatch issues between client/server
- File perms mismatch resulting in 'unsupported operation' type errors
- The typical 're-export' issues when exporting an imported network file system as something else (capability mismatch)
- Problems with 'special' files: pipes, unix domain sockets
Since you have a block-level protocol there is really nothing to configure. All you have to decide on is a Linux file system.
Nomenclature
The machine hosting the disk, is called an iSCSI server The disk itself, a shared resource on said machine, is a target. The client to access the server over a network, is an Initiator.
Target Software
For the target software, we will use:
- The Linux kernel
- Kernel module target_core_mod
- Kernel module iscsi_target_mod
- targetcli-fb utility
The modules will be automatically loaded by Slackware-current, so nothing to do there.
I installed targetcli-fb with slkpg -s sbo targetcli-fb. This little utility controls the configuration of the kernel modules above.
Initiator Software
For the initiator we will use:
- The Linux kernel.
- module scsi_transport_iscsi
- module iscsi_tcp
- module libiscsi
- open-iscsi
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.
Target Configuration
First, get the initiator ID from the initiator (client):
# cat /etc/iscsi/initiatorname.iscsi
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:
slpkg -s sbo targetcli-fb
Targetcli requires a directory to store its data, make sure it exists:
# mkdir /etc/target
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.
Sources
- Originally written by User bifferos