Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



Linux++:::: linux iscsi initiator & variant iscsi targets
Posted at 14.Nov,2006 13:46  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

Now that I've run and setup the openfiler vmware appliance and tested from MS windows (with MS iscsi initiator), I figured it's about time to test out linux iscsi initiator.

There are many iscsi initiator for linux, but the two I tested are open-iscsi and core-iscsi

First, core-iscsi initiator. This is a revived project and not much information exists in it's web site. Much can be gleaned via google or the linux-iscsi wiki

I'm using fc6 with kernel 2.6.18. There were some kernel changes made starting with 2.6.18, one of which is the move of utsrelease from version.h to utsrelease.h

Initially compiling:

  make initiator KERNEL_DIR=/lib/modules/2.6.18-1.2798.fc6/build
  ...
  /tmp/core-iscsi-tools-v3.5/core-iscsi-v1.6.2.9/iscsi_initiator_linux.c: In function ‘iscsi_linux_info’:
  /tmp/core-iscsi-tools-v3.5/core-iscsi-v1.6.2.9/iscsi_initiator_linux.c:1037: error: expected ‘)’ before ‘UTS_RELEASE’
  /tmp/core-iscsi-tools-v3.5/core-iscsi-v1.6.2.9/iscsi_initiator_linux.c:1038:  warning: too few arguments for format
  make[2]: ***  [/tmp/core-iscsi-tools-v3.5/core-iscsi-v1.6.2.9/iscsi_initiator_linux.o] Error 1

Adding the utsrelease.h header files seems to clear this problem.

After a successful compilation, I aborted the test since the operation seems too complex compared to open-iscsi.

Installing open-iscsi on fc6 is easy enough.:

  yum install iscsi-initiator-utils

Once installed, we need to discover our targets first:

  iscsiadm -m discovery -t sendtargets -p 192.168.0.243
  192.168.0.243:3260,1000 iqn.1992-08.com.netapp:sn.84255684 

You'll get something like this, the iqn of the target which we can use to setup a session:

  iscsiadm -m node -T iqn.1992-08.com.netapp:sn.84255684 -p 192.168.150.243 -l

and dmesg should give us something similar:

  sd 6:0:0:103: Attached scsi generic sg1 type 0
  Vendor: NETAPP    Model: LUN               Rev: 0.2
  Type:   Direct-Access                      ANSI SCSI revision: 04
  SCSI device sdb: 31457280 512-byte hdwr sectors (16106 MB)
  sdb: Write Protect is off
  sdb: Mode Sense: bd 00 00 08
  SCSI device sdb: drive cache: write through
  SCSI device sdb: 31457280 512-byte hdwr sectors (16106 MB)
  sdb: Write Protect is off
  sdb: Mode Sense: bd 00 00 08
  SCSI device sdb: drive cache: write through
  sdb: unknown partition table
  sd 6:0:0:107: Attached scsi disk sdb
  sd 6:0:0:107: Attached scsi generic sg2 type 0

or /var/log/messages:

  Nov 14 13:41:39 tokey kernel: sd 6:0:0:103: Attached scsi generic sg1 type 0
  Nov 14 13:41:39 tokey kernel:   Vendor: NETAPP    Model: LUN               Rev: 0.2
  Nov 14 13:41:39 tokey kernel:   Type:   Direct-Access                        ANSI SCSI revision: 04
  Nov 14 13:41:39 tokey kernel: SCSI device sdb: 31457280 512-byte hdwr sectors (16106 MB) 
  Nov 14 13:41:39 tokey kernel: sdb: Write Protect is off
  Nov 14 13:41:39 tokey kernel: SCSI device sdb: drive cache: write through
  Nov 14 13:41:39 tokey kernel: SCSI device sdb: 31457280 512-byte hdwr sectors (16106 MB)
  Nov 14 13:41:39 tokey kernel: sdb: Write Protect is off
  Nov 14 13:41:39 tokey kernel: SCSI device sdb: drive cache: write through
  Nov 14 13:41:39 tokey kernel:  sdb: unknown partition table
  Nov 14 13:41:39 tokey kernel: sd 6:0:0:107: Attached scsi disk sdb
  Nov 14 13:41:39 tokey kernel: sd 6:0:0:107: Attached scsi generic sg2   type 0
  Nov 14 13:41:40 tokey iscsid: connection1:0 is operational now

As you can guess, this is a NetApp appliance. Initially I got a Type: unknown when setting up a session. The problems were:

  • sd_mod was not loaded
  • my iqn (in /etc/iscsi/initiatorname.iscsi) was not set in the NetApp appliance. This step was not needed for the openfiler target.

Now, all I need to do is fdisk /dev/sdb, mke2fs, and I'm done.


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/111/tbping 

Comments
Post a comment