Ubuntu iSCSI SAN HowTo
For those of us who can't afford a real iSCSI SAN, I've put together a quick tutorial on making your own using
Ubuntu Server 7.04 and
iscsi-target. I created my SAN with an AMD Athlon64 X2 AM2 3800+ with 2GB DDR2 800 RAM, a 20GB IDE HDD for the OS and 4 250GB HDD's I had lying around. First download and install
Ubuntu. It was pretty straightforward so I won’t get into that part of it. Once
Ubuntu is installed get all the updates, including any kernel updates:
#
sudo apt-get update
#
sudo apt-get dist-upgrade
#
sudo apt-get upgrade
Once all the updates are installed reboot. Now you need to install a few more packages:
#
sudo apt-get install make
#
sudo apt-get install libssl-dev
#
sudo apt-get install linux-headers-`uname -r`
#
sudo apt-get install gcc
Now make a symlink to your kernel source:
#
sudo ln -s /usr/src/linux-headers-`uname -r` /usr/src/linux
This way make can find your kernel source files when you compile scsi-target without any other configuration from you.
Now download iscsi-target from
http://sourceforge.net/project/showfiles.php?group_id=108475. Unzip and untar the file, the cd into the directory you extracted it to. Now:
#
make
#
sudo make install
If you don’t get any errors iscsi-target is installed. I did find one compatibility problem with the startup script with
Ubuntu. To fix it edit /etc/init.d/iscsi-target by changing the first line from
#!/bin/sh
to
#!/bin/bash
Now copy the ietd.conf file from the etc/ directory under the directory where you compiled iscsi-target to the systems /etc directory. You should read the man files and all associated documentation, but the only things you need to worry about to get up and running are the ‘Target’, ‘Lun 0 Path=’, and ‘Alias’ options. Configure these according to your system, then start up iscsi-target:
#
sudo /etc/init.d/iscsi-target start
Now you just need to configure your iscsi initiators on whatever your want to use the iscsi drives on. I tested it in Windows and in Linux and it works beautifully. You can get MS's free iSCSI initiiator
here. On my Linux server I used the
Linux-iscsi project. So far I’ve only tested it by making one HDD = one LUN, but it should be able to support different types of configurations such as RAID or file LUN’s, and there’s failover support as well. I’ll look into these some more and get the details back to you.
--
BrysonMedlock - 07 Jun 2007