ISCSI/Initiator
Installation[edit | edit source]
Kernel configuration[edit | edit source]
CONFIG_INET=y
, CONFIG_BLK_DEV_SD=y
, CONFIG_SCSI_LOWLEVEL=y
, CONFIG_ISCSI_TCP=M
and CONFIG_SCSI_ISCSI_ATTRS=M
[*] Networking support ---> Networking options ---> [M] TCP/IP networking Device Drivers ---> SCSI device support ---> <*> SCSI disk support [*] SCSI low-level drivers ---> <*> iSCSI Initiator over TCP/IP SCSI Transports ---> {M} iSCSI Transport Attributes
When connecting a tape device, RAID device, or any other special device via iSCSI, remember to select the proper drivers for each device in the kernel. If the devices are known, it is best to enable the appropriate options in the kernel now, instead of waiting to later.
In-kernel support can be enabled by building the driver into the kernel (as suggested with the *
). If building the driver as an external module (as suggested with the M
) running the make modules_install command will install all the modules into the kernel, which is essentially the same as building in the modules initially. Anyway sys-block/open-iscsi says builtin doesn't work. Built-in modules for an active kernel are listened in the /lib/modules/$(uname -r)/modules.builtin file. To check to see if if the iscsi_tcp.ko driver has been built-in, run:
user $
grep iscsi_tcp.ko "/lib/modules/$(uname -r)/modules.builtin"
USE flags[edit | edit source]
USE flags for sys-block/open-iscsi A performant, transport independent, multi-platform implementation of RFC3720
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
infiniband
|
Enable Infiniband RDMA transport support |
libressl
|
Use dev-libs/libressl instead of dev-libs/openssl when applicable (see also the ssl useflag) |
rdma
|
Support iSCSI over RDMA |
systemd
|
Enable use of systemd-specific libraries and features like socket activation or session tracking |
tcp
|
Support iSCSI over TCP |
Emerge[edit | edit source]
After USE flags have been set (or unset) emerge the iSCSI package:
root #
emerge --ask sys-block/open-iscsi
Configuration[edit | edit source]
Loading the module[edit | edit source]
This section is only applicable when the driver has been built as a loadable kernel module (modules are external to the kernel). If the kernel configuration was set and then built as In-kernel support, then the driver will be built-in to the kernel effectively rendering this section unnecessary. Skip down to Usage if this is the case.
Before iscsid startup the lsmod command can be used to confirm the module has been loaded:
root #
lsmod | grep iscsi_tcp
If output is seen from the command above, then the following step is not needed:
root #
modprobe iscsi_tcp
Service[edit | edit source]
OpenRC[edit | edit source]
To add the iSCSI daemon to the default runlevel:
root #
rc-update add iscsid default
To start the iSCSI daemon now:
root #
service iscsid start
Usage[edit | edit source]
Target discovery[edit | edit source]
Discover the targetnames:
root #
iscsiadm -m discovery -t st -p <ip> -P 1
Adding targets[edit | edit source]
Add a target to the configuration:
root #
iscsiadm -m node -T iqn.2004-04.com.<targethost>:<targetname> [-p <ip[:port]>] -l
Target persistence[edit | edit source]
And tell the iscid service to start a target automatically on startup
root #
iscsiadm -m node -T iqn.2004-04.com.<targethost>:<targetname> [-p <ip[:port]>] -o update -n node.startup -v automatic node.conn[0].startup = automatic
See also[edit | edit source]
- ISCSI/Target — machines that offer storage via iSCSI to a network.