Wiki Blog/2008-02-05Linux and Windows working in harmony with iSCSIBeing 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
apt-get install iscsitarget iscsitarget-modules-2.6-686
# less /etc/ietd.conf
Target iqn.2007-01.com.mydomain:mymachine.storage
Lun 0 Path=/dev/sda,Type=fileio,IOMode=ro
/etc/init.d/iscsitarget restart Installing the iSCSI initiator ("client") on Windows
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!
A word about un-initialized Disks in WindowsWhen 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 TimeWhen 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 WindowsBesides the already mentioned, free Microsoft iSCSI Initiator, there are two pieces of software from Rocket Division called 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. © Copyright 2004 - 2006 Nicola Fankhauser. All Rights Reserved. |