Difference between revisions of "Open-iSCSI"

From ArchWiki
Jump to navigation Jump to search
(brought short back article summary sentence)
(move info about old the linux-iscsi project into Note in Install section)
Line 11: Line 11:
  
 
This article describes how to access an iSCSI target with the [http://open-iscsi.org/ Open-iSCSI] initiator.
 
This article describes how to access an iSCSI target with the [http://open-iscsi.org/ Open-iSCSI] initiator.
 
The preferred initiator is [http://open-iscsi.org/ Open-iSCSI] as of 2011. An older initiator, [http://sourceforge.net/projects/linux-iscsi/ Linux-iSCSI], was merged with Open-iSCSI.
 
Linux-iSCSI should not be confused with linux-iscsi.org, the website for the LIO [[iSCSI Target|target]].
 
  
 
== Setup With Open-iSCSI ==
 
== Setup With Open-iSCSI ==
 
{{Pkg|open-iscsi}} is available in the official repositories. Install it with {{bc|# pacman -S open-iscsi}}
 
{{Pkg|open-iscsi}} is available in the official repositories. Install it with {{bc|# pacman -S open-iscsi}}
 +
 +
{{Note|An older initiator, [http://sourceforge.net/projects/linux-iscsi/ Linux-iSCSI], was merged with Open-iSCSI in April 2005.
 +
This should not be confused with [http://linux-iscsi.org/ linux-iscsi.org], the website for the LIO [[iSCSI Target|target]].}}
  
 
=== Using the Daemon ===
 
=== Using the Daemon ===

Revision as of 23:47, 23 August 2014

With Wikipedia:iSCSI you can access storage over an IP-based network.

The exported storage entity is the target and the importing entity is the initiator.

This article describes how to access an iSCSI target with the Open-iSCSI initiator.

Setup With Open-iSCSI

open-iscsi is available in the official repositories. Install it with

# pacman -S open-iscsi
Note: An older initiator, Linux-iSCSI, was merged with Open-iSCSI in April 2005. This should not be confused with linux-iscsi.org, the website for the LIO target.

Using the Daemon

You only have to include the IP of the target as SERVER in /etc/conf.d/open-iscsi at the client.

At the server (target) you might need to include the client iqn from /etc/iscsi/initiatorname.iscsi in the acl configuration.

After both steps are finished you should be able to start the initiator with

# systemctl enable open-iscsi.service
# systemctl start open-iscsi.service

You can see the current sessions with

# systemctl status open-iscsi.service

Using the Tools

iscsid has to be running.

Target discovery

# iscsiadm -m discovery -t sendtargets -p <portalip>

Delete obsolete targets

# iscsiadm -m discovery -p <portalip> -o delete

Login to available targets

# iscsiadm -m node -L all

or login to specific target

# iscsiadm -m node --targetname=<targetname> --login

logout:

# iscsiadm -m node -U all

Info

For running session

# iscsiadm -m session -P 3

The last line of the above command will show the name of the attached dev e.g

Attached scsi disk sdd State: running

For the known nodes

# iscsiadm -m node

Online resize of volumes

If the iscsi blockdevice contains a partitiontable, you will not be able to do an online resize. In this case you have to unmount the filesystem and alter the size of the affected partition.

  1. Rescan active nodes in current session
    # iscsiadm -m node -R
  2. If you use multipath, you also have to rescan multipath volume information.
    # multipathd -k"resize map sdx"
  3. Finally resize the filesystem.
    # resize2fs /dev/sdx

Tips

You can also check where the attached iSCSI devices are located in the /dev tree with ls -lh /dev/disk/by-path/* .

See also

  • iSCSI Boot Booting Arch Linux with / on an iSCSI target.