|
|
Connect to an iSCSI Volume with Ubuntu or Debian LinuxFrom ezUnix
IntroductionInternet SCSI (iSCSI) is a network protocol that allows you to use the SCSI protocol over TCP/IP networks.
This HowTo will explain how to format and connect to an iSCSI Volume under Debian / Ubuntu Linux.
Required SotwareYou need to install open-iscsi package for high performance, transport independent iSCSI implementation under Debian / Ubuntu Linux.
InstallationType following command in order to install Open-iSCSI initiator # sudo apt-get install open-iscsi
ConfigurationDefault configuration file could be located at /etc/iscsi/iscsid.conf or ~/.iscsid.conf.
node.startup = automatic node.session.auth.username = MY-ISCSI-USER node.session.auth.password = MY-ISCSI-PASSWORD discovery.sendtargets.auth.username = MY-ISCSI-USER discovery.sendtargets.auth.password = MY-ISCSI-PASSWORD node.session.timeo.replacement_timeout = 120 node.conn[0].timeo.login_timeout = 15 node.conn[0].timeo.logout_timeout = 15 node.conn[0].timeo.noop_out_interval = 10 node.conn[0].timeo.noop_out_timeout = 15 node.session.iscsi.InitialR2T = No node.session.iscsi.ImmediateData = Yes node.session.iscsi.FirstBurstLength = 262144 node.session.iscsi.MaxBurstLength = 16776192 node.conn[0].iscsi.MaxRecvDataSegmentLength = 65536 Where node.session.* is used to set a CHAP username and password for initiator authentication by the target(s).
# /etc/init.d/open-iscsi restart Now you need to run a discovery against the iscsi target host: # iscsiadm -m discovery -t sendtargets -p ISCSI-SERVER-IP-ADDRESS If 192.168.1.2 is iSCSI server IP address, enter: # iscsiadm -m discovery -t sendtargets -p 192.168.1.2 Or # iscsiadm --mode discovery --type sendtargets --portal 192.168.1.2 Note down the record id (such as iqn.2001-05.com.doe:test) found by the discovery.
# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.2:3260 --login Finally restart the service again: # /etc/init.d/open-iscsi restart
Format and mount the iSCSI VolumeNow you should see an additional drive on the system such as /dev/sdi. Now there should be a block device under /dev directory. To obtain new device name, type: # fdisk -l
# tail -f /var/log/messages You can now partition the drive with fdisk, i.e. if your device name is /dev/sdi # fdisk /dev/sdi Enter following command to format a partition: # mkfs.ext4 /dev/sdi1 Mount file system: # mkdir /iscsi # mount /dev/sdi1 /iscsi
CaveCatsOn Debian Linux you may need to create following symlinks : # ln -s /etc/{iscsid.conf,initiatorname.iscsi} /etc/iscsi/
|