HomePage
WikiBlog
RecentChanges
LikePages
BackLinks
FindPage

Blog entries

2010-02-16: RSS-Feeds für ricardo.ch-Suchergebnisse

2010-02-15_spam: Disabling public editing

2010-02-15: Show Processes waiting for I/O in Linux

2010-02-13: Sony Vaio P in der Schweiz...

2009-06-17: Wie man plötzlich zum Mörder wird (weil's einfach besser 'rüberkommt!)

2008-05-18: Recreating SSL keys for stunnel, lighttpd and dovecot following the Debian-OpenSSL debacle

2008-02-12: Patch for aoeserver in Kernel 2.6.24

2008-02-07: Usage of open-iscsi on Linux

2008-02-05: Linux and Windows working in harmony with iSCSI

2008-01-19: Linksys PAP2 FXS Port Impedance

< March, 2010 >
Sun Mon Tue Wed Thu Fri Sat
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

Wiki Blog/2008-02-07

Usage of open-iscsi on Linux

Setting up a iSCSI target ("server") on linux with the daemon "ietd" is quite simple:

Target iqn.2007-01.com.mydomain:mymachine.storage
        Lun 0 Path=/dev/sda,Type=fileio,IOMode=ro

However acting as a iSCSI initiator ("client") on linux is a bit mor complicated, thanks to the non-existence of straight-forward documentation about "iscsiadm". Still, I managed to figure out (with a little help from a nice How-To about iSCSI on linux) how it works.

Install open-iscsi

apt-get install open-iscsi

Discover your iSCSI targets

Type the following (on a single line, or through cut and paste):

iscsiadm \
  --mode discovery \
  --type sendtargets \
  --portal my_iSCSI_target_machine

This will give you something like this:

my_iSCSI_target_machine:3260,1 iqn.2007-01.com.mydomain:mymachine.storage

Login to a target

Now run this (again on a single line, or through cut and paste):

iscsiadm \
  --mode node \
  --targetname iqn.2007-01.com.mydomain:mymachine.storage \
  --portal my_iSCSI_target_machine \
  --login

This will have added a new SCSI device. To find out which, run this:

dmesg  | tail

Which results on my system in this:

sd 1:0:0:0: ?[sdb] 4782905 512-byte hardware sectors (2449 MB)
sd 1:0:0:0: ?[sdb] Write Protect is off
sd 1:0:0:0: ?[sdb] Mode Sense: 77 00 00 08
sd 1:0:0:0: ?[sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 1:0:0:0: ?[sdb] 4782905 512-byte hardware sectors (2449 MB)
sd 1:0:0:0: ?[sdb] Write Protect is off
sd 1:0:0:0: ?[sdb] Mode Sense: 77 00 00 08
sd 1:0:0:0: ?[sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 sdb: sdb1 < sdb5 >
sd 1:0:0:0: ?[sdb] Attached SCSI disk

This means that my new device is called "/dev/sdb". Let's mount the first partition!

mkdir /storage
mount /dev/sdb1 /storage
 
Add a Comment
Summary:
Comment:

Last edited on 7.02.2008 9:42.


Edit | PageHistory | Diff | PageInfo

© Copyright 2004 - 2006 Nicola Fankhauser. All Rights Reserved.