ISCSI Initiator Tagret on Ubuntu GNU Linux 8 04 LTS
id : yittal7q1o
category : computer
blog : unixlinux
created : 02/12/10 - 20:24:30

Target :

Installation :

  • First of all install target (server) binaries on the server :
root@target# apt-get install iscsitarget

  • And verify if service is currently running :
root@target# ps -edf | grep ietd | grep -v grep
root      4269     1  0 16:40 ?       00:00:00 /usr/sbin/ietd
root@target# netstat -antp | grep LISTEN | grep 3260
tcp    0    0*   LISTEN    4269/ietd

  • You're done with installation !

Configuration :

We want to add 3 SCSI target :
    • One on /dev/sda2 (for a ftp, on ext3)
    • One on /dev/sda3 (for an apache, on ext3)
    • One on /dev/sda4 (for a IIS, on NTF)

  • Edit /etc/ietd.conf and add :
#Our configuration :
#Target for ftp => ext3; /dev/sda2
        Lun 0 Path=/dev/sda2,Type=fileio

#Target for apache => ext3, /dev/sda3
        Lun 0 Path=/dev/sda3,Type=fileio

#Target for IIS => ntfs, /dev/sda4
        Lun 0 Path=/dev/sda4,Type=fileio

  • Restart ietd service :
root@target# /etc/init.d/ietd restart

  • And verify your configuration :
root@target# cat /proc/net/iet/volume
        lun:0 state:0 iotype:fileio iomode:wt path:/dev/sda4
        lun:0 state:0 iotype:fileio iomode:wt path:/dev/sda3
        lun:0 state:0 iotype:fileio iomode:wt path:/dev/sda2

Initiator :

  • You now need to configure your initiator (client) on each machine (ftp, apache, iis) :

On Linux (ftp, apache) :

Installation :

  • First of all install open-scsi initiator (client) :
root@client# apt-get install open-iscsi

  • And discovery targets (mode discovery, just listen available targets on iscsi server) :
root@client# iscsiadm --mode discovey --type sendtargets --portal,1,1,1

Configuration :

  • Now establish a session with wanted target (mode node, in this exemple :
root@client# iscsiadm --mode node --targetname --portal --login
Login session [iface: default, target:, portal:,3260]

  • To enable your session at server reboot just modifiy your /etc/iscsi/iscsid.conf and replace the line :
    • node.startup = manual
    • node.startup = automatic

  • You can enable a setup by session :
root@client# iscsiadm --mode node --targetname --op update --name node.startup
--value automatic

  • To remove a session just use iscsi command with --logout parameter :
root@client# iscsiadm --mode node --targetname --portal --logout
Logout session [sid: 1, target:, portal:,3260]

  • Be sure youre initiator name is uniq on the network :
root@client# cat /etc/iscsi/initiatorname.isci

On Windows (IIS)



  • You're done