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 


Tested on:

  • Debian Squeezy
  • Debian Wheezy
  • Ubuntu Natty




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

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.


On wheezy you just run:

# apt-get install iscsitarget iscsitarget-dkms

and it will install the kernel modules.


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



Add there something such as:

       IncomingUser user_name password
       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


<comments />

Olivia said ...

<comment date="2012-10-15T04:05:56Z" name="Olivia"> Hi,I recently found two prelobms, audio streaming and font in Debian testing amd64.The audio streaming will go missing , if the pulseaudio packages installed.(gnome-audio gstreamer0.10-pulseaudio libasound2-plugins pulseaudio pulseaudio-esound-compat pulseaudio-module-x11 pulseaudio-utils)Only if it installed ALSA and OSS, the problem won't happen.The other is that snowglobe2 text become unclean, and it maybe needs to disable autohint or something.I'm sure that there is no problem in snowglobe1.Finally thank you for the excellent work. </comment>

Fiie said ...

<comment date="2012-10-15T06:41:49Z" name="Fiie">

 Android  with Linux completely but then you wlodun’t be able to use your Android phone as a phone anymore. I know that's not true at all. It would take a lot of work but you could most definitely replace the Android OS and use your phone as a phone. Most likely, however, you'd need a separate pre-compiled  image  (zImage and a rootfs) for each specific device.