User manual

164
4.5.2.3 Connect to the iSCSI targets by Open-iSCSI Initiator on Ubuntu Linux
This section shows you how to use Linux Open-iSCSI Initiator on Ubuntu to add the iSCSI target (QNAP
NAS) as an extra partition. Before you start to use the iSCSI target service, make sure you have
created an iSCSI target with a LUN on the NAS and installed the correct iSCSI initiator for your OS.
A bout Linux Ope n- iSCSI Initia to r
The Linux Open-iSCSI Initiator is a built-in package in Ubuntu 8.04 LTS (or later). You can connect to
an iSCSI volume at a shell prompt with just a few commands. More information about Ubuntu is
available at http://www.ubuntu.com and for information and download location of Open-iSCSI, please
visit: http://www.open-iscsi.org
Be fo r e y ou sta rt
Install the open-iscsi package. The package is also known as the Linux Open-iSCSI Initiator.
# sudo apt-get install open-iscsi
Now follow the steps below to connect to an iSCSI target (QNAP NAS) with Linux Open-iSCSI Initiator.
You may need to modify the iscsid.conf for CHAP logon information, such as node.session.auth.
username & node.session.auth.password.
# vi /etc/iscsi/iscsid.conf
Save and close the file, then restart the open-iscsi service.
# /etc/init.d/open-iscsi restart
Discover the iSCSI targets on a specific host (the QNAP NAS in this example), for example, 10.8.12.31
with default port 3260.
# iscsiadm -m discovery -t sendtargets -p 10.8.12.31:3260
Check the available iSCSI node(s) to connect.
# iscsiadm -m node
** You can delete the node(s) you do not want to connect to when the service is on with the following
command:
# iscsiadm -m node --op delete --targetname THE_TARGET_IQN
Restart open-iscsi to login all the available nodes.
# /etc/init.d/open-iscsi restart
You should be able to see the login message as below:
Login session [iface: default, target: iqn.2004-04.com:NAS:iSCSI.ForUbuntu.B9281B, portal:
10.8.12.31,3260] [ OK ]
Check the device status with dmesg.
# dmesg | tail