Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am wanted to use LIO iscsi-target software on my Ubuntu server to host a target for my VMware box.

The only issue is I cannot seem to find any kind of guide or steps to go about compiling a new kernel with the modifications needed.

Any idea how I could go about this process?

I did find this, but it is for CentOS so I under the impession it will not work for me, or will it?

share|improve this question
    
What did you find? There's no link in your question. –  womble Jul 21 '11 at 3:12
    
I added a link to the page. –  Solignis Jul 21 '11 at 3:22

2 Answers 2

up vote 4 down vote accepted

I wrote one a while back for OpenSUSE (link), which you may have already run into during your googling. Since that's for an RPM-based distribution all the steps aren't 100% accurate.

What you want to do is entirely possible on Ubuntu. The first step is to get a local Kernel source-archive locally. That's extensively documented here. The key step is

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
apt-get source linux-image$(uname -r)

Which will get it locally. Read the whole thing for more on the details of compiling stuff for kernels.

From there, you need to pick up the LIO archive from the backports channel (see my link).

git clone git://linux-iscsi.org/lio-core-backports.git lio-core-backports.git
git clone git://git.kernel.org/pub/scm/linux/storage/lio/lio-utils lio-utils.git

Next step: prepare the kernel. Change-directory into the kernel source (most likely /usr/src/linux) and run the following pair of commands:

make oldconfig
make prepare

This will prep the kernel for compiling modules for your current kernel rev.

Next, change into the lio-core-backports.git directory you created above and run:

./autoconfig
make
make install

Errors here are likely to due to the kernel archive not being prepped correctly. The last step here actually installs the modules. Now to install the utilities that make managing this easier.

Change into the lio-utils.git directory and repeat the above commands.

You now have (probably) LIO-Target installed. Time to get your config file worked up. Once you've gotten to the point of figuring out how to get the config files tweaked just right, you already have the kernel modules installed and ready to roll.


Disclaimer: I am minimally familiar with how Ubuntu's package manager works, so the above apt-get stuff was pulled directly from documentation. Your actual commands may vary. Batteries not included.

share|improve this answer
    
I am just curious but what happens when Ubuntu comes out with an update and I using a modified kernel? –  Solignis Jul 21 '11 at 2:38
    
You have to recompile. Happily, once you have the bugs worked out of the work-flow it goes pretty fast. Since you're building a storage appliance, plan your outages for updates accordingly. –  sysadmin1138 Jul 21 '11 at 2:43
    
Good point, because it will be my primary storage I can't just do updates as I see them. –  Solignis Jul 21 '11 at 3:21
    
I couldn't help but notice that you start your most recent post with this sentence. LIO-Target is one of several iSCSI modules available for Linux. As of the 2.6.38 kernel it'll be baked in Now I am wondering if Ubuntu might change to LIO. I know they moving kernels with the next version 11.10 I think I will go ask about this on the Ubuntu forums maybe a developer can give me more insight. Thanks for the info, I am going to have to take a look at you "blog" seems like I might find some good stuff there. –  Solignis Jul 21 '11 at 3:27

It's a little more complicated to make this work on Ubuntu. I have done it on a 3.2 kernel, but I think everything was already OK in the 3.0 kernel.

Grab from either kernel.org or rts git: configshell < make deb & install deps & dpkg -i targetcli < make deb & install deps & dpkg -i rtslib < make deb & install deps & dpkg -i lio-utils < run dpkg-buildpackage in ./debian

after installing lio-utils I had to chmod 755 /usr/lib/python/dist-packages/tcm_*py

after /etc/init.d/target start I had to manually mount configfs once and restart target once more

After that you should be able to run the status command.

root@klappstuhl:~# /etc/init.d/target status
[---------------------------] TCM/ConfigFS Status [----------------------------]

[---------------------------] LIO-Target Status [----------------------------]

Statements that it is not working without the commercial tools seem to be mostly FUD.

The build is not very easy and the documentation has not seen love since Ubuntu 7, but it'd still be nice if Ubuntu could concentrate on properly packaging this software instead of older one like (iet not having proper reservations and tgtd being unable to use initiator group ACLs - NO a ip/netmask setting is NOT an initiator group!)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.