Welcome! Log In Create A New Profile


Howto: Configure your GoFlex Net (should work for Dockstar too) to act as an iSCSI Enterprise Target

Posted by Vlad 
In this howto I'd like to describe how to get iSCSI running on a GoFlex Net. Because of its 2 SATA ports GoFlex Net is really predestinated to be an iSCSI target. When using iSCSI in my Gbit LAN I get about 40-50MB/s for an ext4 partition and about 30MB/s for NTFS. The best thing is, however, the client side encryption. I can use my favourite aes-xts-plain without worrying about the crappy ARM CPU of the GoFlex because the encryption is handled completely by my x86 machine. Thus I get about 25-30MB/s when writing on an encrypted ext4 partition. Compared to the lame 6-8MB/s I got when letting GoFlex Net handle the encryption, this is a real boost.

The main difficulty about installing iSCSI on the GoFlex, is that it comes with a special kernel module which must be compiled against the kernel you're using. The usual way to use dkms on the GoFlex fails. Here I assume that you're running Debian Squeeze and using the 3.0.0 Debian kernel from my howto. You must also install the kernel headers as described in the "Installing the kernel headers" section of that howto. On my laptop I'm using Ubuntu 11.04. Now ssh to your GoFlex

First we want to enable the testing repository.
nano /etc/apt/preferences
paste this
Package: *
Pin: release a=stable
Pin-Priority: 900

Package: *
Pin: release o=Debian
Pin-Priority: -10
Then open
nano /etc/apt/apt.conf
and add this
APT::Default-Release "stable";
Finally open
nano /etc/apt/sources.list
and add
deb http://ftp.debian.org/debian/ testing main contrib
deb-src http://ftp.debian.org/debian/ testing main contrib
Now we fetch the source for iscsitarget from the testing repo.
apt-get update
apt-get source -t testing iscsitarget
ls -al
You should see a new folder called "iscsitarget-". Copy this folder to your Linux box. From there
open a terminal and cd to the copied folder. We'll have to patch the Makefile to enable support of the 3.0.0 kernel. I got the patch from here
-> Patches -> improved kernel version comparision semantics in Makefile
For convenience I attached the patch to this post. Download "iscsi-makefile.patch" and save it to iscsitarget- Apply the patch and go to the cross-compie environment
patch < iscsi-makefile.patch
When you run "make" you must give the path to your kernel sources. For example, if the sources are in "~/Kernel/linux-source-3.0.0/" then you should run
make ARCH=arm CC=arm-none-linux-gnueabi-gcc  KSRC=~/Kernel/linux-source-3.0.0/
This should compile without any errors. Copy the whole iscsitarget- folder back to the GoFlex and cd to the folder on the GoFlex. Then run
ln -s /usr/src/linux-headers-3.0.0-goflex/ /lib/modules/3.0.0-goflex/build
make install
This should install iscsi-target on the GoFlex. To uninstall use
make uninstall
O.K., let's make sure that the iscsi module works fine
modprobe iscsi_trgt
Now we need to tweak the startup scripts a bit. In particular, it's a good idea to replace the content of /etc/init.d/iscsi-target by the script from Debian's iscsitarget package.
nano /etc/init.d/iscsi-target
The script from Debian's iscsitarget package is also attached to this post.
Now we make sure that iscsi starts automatically on boot.
update-rc.d iscsi-target defaults
And of course, we need to take care of the configuration files.
echo 'ISCSITARGET_ENABLE=true' > /etc/default/iscsitarget
nano /etc/iet/ietd.conf
The relevant part of the file may look like this. Here I use nothing fancy, just one of my SATA HDDs where the path is given via /dev/disk/by-id.
Target iqn-2011-09.mytop.mynet:storage.seagate
        IncomingUser mylogin mypass
        Outgoing User
        Lun 0 Path=/dev/disk/by-id/scsi-SATA_ST9160411ASG_5TG0AX3A,Type=blockio
The placeholder mytop.mynet is for the local domain name of my home network. I'm not sure if you really need real FQDNs with a local DNS server or if something like "ip-adress mygoflex.mynet.mytop mygoflex" in /etc/hosts should be enough. For the record, I have real FQDN via dnsmasq on my Asus WL500GP. "mylogin" and "mypass" stand for login and password, the authentication is handled via CHAP. I also use blockio. Although fileio is supposed to be faster, I couldn't notice any difference.

Well, that actually should be enough
/etc/init.d/iscsi-target start
and the output should be
Starting iSCSI enterprise target service:.

On my Ubuntu box, accessing iSCSI is very easy.
apt-get install open-iscsi
I don't think you really need to configure anything. To acess the target I do the following
sudo -s
iscsiadm -m discovery -t st -p 192.168.xx.xx
iscsiadm -m node --targetname "iqn-2011-09.mytop.mynet:storage.seagate" --portal "192.168.xx.xx:3260" --op=update --name node.session.auth.authmethod --value=CHAP
iscsiadm -m node --targetname "iqn-2011-09.mytop.mynet:storage.seagate" --portal "192.168.xx.xx:3260" --op=update --name node.session.auth.username --value=mylogin
iscsiadm -m node --targetname "iqn-2011-09.mytop.mynet:storage.seagate" --portal "192.168.xx.xx:3260" --op=update --name node.session.auth.password --value=mypass
iscsiadm -m node --targetname "iqn-2011-09.mytop.mynet:storage.seagate" --portal "192.168.xx.xx:3260" --login
I mostly use it for backups and after the backup has been done I simply disconnect the target.
iscsiadm -m node --targetname "iqn-2011-09.mytop.mynet:storage.seagate" --portal "192.168.xx.xx:3260" -u
What is cool, is that Clonezilla supports iSCSI out of the box. I got all the infos from this blog
So you basically start Clonezila and when it proposes you to proceed or go to the console, you hit Alt F2. Then you do
sudo -s
dhclient eth0
nano /etc/iscsi/iscsid.conf
Uncomment and set the following values
node.statrtup = automatic
node.session.auth.authmethod = CHAP
node.session.auth.username = mylogin
node.session.auth.password = mypass
After that
/etc/init.d/open-iscsi start
iscsiadm -m discovery -t sendtargets -p 192.168.xx.xx
iscsiadm -m node -p 192.168.xx.xx:3260 -l
Finally you hit Alt F1 and proceed with the Clonezilla. The iSCSI target drive appears in the list and can be used as a backup/recovery drive.

BTW. If you can scan the server but don't see any targets, check if you have a file called /etc/initiators.allow. Delete it.

Edited 2 time(s). Last edit at 10/15/2011 04:15PM by Vlad.
open | download - iscsi-makefile.patch (1.4 KB)
open | download - iscsi-target (3.1 KB)

Your Email:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.