November 18, 2011, Friday, 321

Install iSCSI Target on Debian or Ubuntu Linux

From ezUnix

Jump to: navigation, search
                                    pdf_icon.png Download this article as a single PDF document 


Contents

Software

Tested on:

  • Debian Squeezy
  • Debian Wheezy
  • Ubuntu Natty


Installation

Debian

Squeezy

Install the packages:

# apt-get install iscsitarget-source
# apt-get install iscsitarget

Pay attention that you will probably get an error when installing the last package, the error is :

Starting iSCSI enterprise target service: FATAL: Module iscsi_trgt not found.
netlink fd
: Connection refused
failed.

The error is normal, because we still didn't build the kernel module to use for iSCSI.
Installing the iscsitarget-source package will provide us with all the tools we need to build the kernel module.

So, let's build it with this command :

# m-a a-i iscsitarget

Now you need to load the module:

# modprobe iscsi_trgt

Your system is now ready. You can known configure your iSCSI target.


Wheezy

On wheezy you just run:

# apt-get install iscsitarget iscsitarget-dkms

and it will install the kernel modules.


Ubuntu

On Ubuntu, it's very simple as the package is available in the main stable repository.
All you have to do is to simply run following command :

# apt-get install iscsitarget


Add an iSCSI target

Edit

/etc/iet/ietd.conf

Add there something such as:

Target iqn.2011-08.com.ezunix.fridge:storage.raid5.lun0
       IncomingUser user_name password
       OutgoingUser
       Lun 0 Type=fileio,Path=/dev/md0,ScsiId=odin0,ScsiSN=20110830
       Alias LUN0

Read man 5 ietd.conf for details about the values in ietd.conf

After you're finished configuring it run:

# /etc/init.d/iscsitarget start



Cheers,
Marcin


<comments />
Talk:Install iSCSI Target on Debian or Ubuntu Linux