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

< July, 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-05

Linux and Windows working in harmony with iSCSI

Being always interested in better managing my private music and film collection, I recently found some time to play around with alternative file systems.

One very interesting technology is iSCSI, giving you the ability to access raw disks (or image files) over TCP/IP. A little How-To showing how to set up iSCSI with Debian:

Installing the iSCSI target ("server") on Debian/Linux

  • Install the package iscsitarget and its module:
apt-get install iscsitarget iscsitarget-modules-2.6-686
  • Configure your iSCSI target ("server") like this. The "IOMode=ro" parameter is very important if you have mounted the same disk already in your linux box!
# less /etc/ietd.conf
Target iqn.2007-01.com.mydomain:mymachine.storage
        Lun 0 Path=/dev/sda,Type=fileio,IOMode=ro
  • Restart the iSCSI daemon:
/etc/init.d/iscsitarget restart

Installing the iSCSI initiator ("client") on Windows

  • Get the Microsoft iSCSI initiator ("client") and install it on your Windows machine. You'll have a new program installed called "Microsoft iSCSI Initiator". Run it, enter the IP-address (or the DNS name) or your Linux/Debian box in the "Discovery" tab, switch to the "Targets" tab, press "Refresh" and select your partition "iqn.2007-01.com.mydomain:mymachine.storage", press "Log on". You can inspect the newly added disk in the management console.
  • Install Ext2fsd. Start the Ext2fsd Volume Manager, pick your iSCSI disk, right-click it and select the option "Change drive letter". Now assign a free drive letter to it. There is no need to start the Ext2fsd Manager subsequently, you basically just need the drivers it provides, along with the drive letters.

A word of caution: I found that the Ext2fsd Volume Manger application tends to crash the system. Which the Ext2fsd driver might do itself as well, so beware and make backups first!

  • Now open a new Explorer window and just pick the newly appeared drive letter. It should load the root directory of your iSCSI-exported linux box. You get a read-only access to your (live) Ext3 partition over iSCSI!

A word about un-initialized Disks in Windows

When connecting disks read-only via iSCSI to Windows machines, you can have the situation that it does not recognize it correctly. There is a red One-Way sign in the drive manager in the management console. The remedy is to unmount any mounted file system on that disk on the linux box, export briefly as writable, initialize the disk from Windows, then change back to read-only again on the linux box iSCSI configuration. Windows will now correctly treat the disk as valid.

Creating Disk Images on Linux with Sparse Files to Save Space and Time

When creating a new disk image with "dd" on linux, use the following syntax to greatly reduce space consumption and time:

dd if=/dev/zero of=mynewdisk.img bs=1MB seek=10000 count=0

This command takes about 1 second to complete and uses around zero bytes on your disk!

Tunneling iSCSI over SSH (with compression!)

Now to some very crazy idea: How do I get access to my iSCSI disks from a remote site? Since iSCSI is TCP-based, it should be possible in theory to tunnel it with SSH. However, you need (in my exprience) to use the same port number and IP-address locally as on your iSCSI server (3260 is the default, 127.0.0.1 is always the local machine), since otherwise only the initial communication succeeds and further requests try to reach the iSCSI target directly.

The following example is from the cygwin SSH client, but you can do the same also with Putty:

ssh -C -L 3260:127.0.0.1:3260 myuser@myserver

On your client machine, you now connect to 127.0.0.1:3260 with your iSCSI initiator software and mount the disk as usual.

Omitting the compression flag ("-C") improves performance over fast links and slow machines considerably: My 500Mhz Pentium III server achieves roughly 2.5 mibit/s without compression. With compression the figure drops to about 50% (to 1.2 mibit/s). However tunneling iSCSI over SSH it is not fast at all compared to unencrypted connections.

iSCSI target and initiator software for Windows

Besides the already mentioned, free Microsoft iSCSI Initiator, there are two pieces of software from Rocket Division called StarPort (iSCSI initiator, "client") and StarWind (iSCSI target, "server").

There are free, personal licenses available, even though not all features they offer in their "enterprise-grade" versions are usable. However the most basic iSCSI tasks can be performed. Beware, this software crashed some time on me (mostly the iSCSI initiator, ?StarPort), whereas the Microsofts own iSCSI initiator works very well.

 
Add a Comment
Summary:
Comment:

Last edited on 5.02.2008 13:44.


Edit | PageHistory | Diff | PageInfo

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