La instalación se hará en cuatro fases:
1.- Obtener las fuentes del núcleo de Linux
2.- Compilar un núcleo con el proyecto SCST
3.- Compilar proyecto mhvtl
4.- Configurar dispositivos para mhvtl
El escenario:
Se ha elegido la instalación sobre un Sistema Operativo Centos versión 5.4 de 64 bits. En nuestro AA Labs hemos elegido una máquina virtual hospedada en un VMWARE Server sobre OpenSuse 11.2.
1.- Obtener las fuentes del núcleo de Linux
Documentación:
Wiki CentOS: http://wiki.centos.org/HowTos/I_need_the_Kernel_Source
Procedimiento:
Instalar entorno de compilación y todos los paquetes necesitados para las cuatro fases junto con todas sus dependencias:
# yum install make gcc hmaccalc openssl openssl-devel zlib-devel lsscsi mt-st mtx rpm-build redhat-rpm-config unifdef kernel-headers subversion
Crear usuario vtl y asignar contraseña:
#
useradd vtl
#passwd vtl
Crear directorios /opt/mhvtl y /etc/mhvtl y se hace propietario a nuevo usuario:
#
mkdir /opt/mhvtl
#chown -Rf vtl:vtl /opt/mhvtl
#
mkdir /etc/mhvtl
#chown -Rf vtl:vtl /etc/mhvtl
Loguearse como usuario vtl:
#su – vtl
Conocer la versión del núcleo Linux que corre en tu sistema:
$ uname -a
Linux centos.ferras.local 2.6.18-194.3.1.el5 #1 SMP Thu May 13 13:08:30 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
Desempaquetar y preparar los archivos Fuentes:
[vtl@centos ~]$ cd
[vtl@centos ~]$ mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
[vtl@centos ~]$ echo '%_topdir %(echo $HOME)/rpmbuild' > .rpmmacros
Descargar el paquete de Fuentes que corresponde a la versión de Kernel de tu CentOS/RHEL desde aquí e instalarlo:
$ rpm -i http://mirror.centos.org/centos/5/updates/SRPMS/
kernel-2.6.18-194.3.1.el5.src.rpm$ cd ~/rpmbuild/SPECS
$ rpmbuild -bp --target=`uname -m` kernel-2.6.spec
Comprobar que el árbol de fuentes del kernel esté en /home/vtl/rpmbuild/BUILD/:
$ ls ~/rpmbuild/BUILD/
kernel-2.6.18[vtl@centos SPECS]$ cp -Rf /home/vtl/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64 /usr/src/kernels/
Copiarlos como root a /usr/src/kernels:
#cp -Rf /home/vtl/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.x86_64 /usr/src/kernels/
2.- Compilar un núcleo con el proyecto SCST
Documentación:
Howto ISCSI-SCST: http://iscsi-scst.sourceforge.net/iscsi-scst-howto.txt
Procedimiento:
Como usuario root descargar proyecto scst con subversion y añadir los parches indicados:
# cd /root
# svn co https://scst.svn.sourceforge.net/svnroot/scst/trunk scst
# cd /usr/src/kernels/linux-2.6.18.x86_64
# patch -p1 < /root/scst/iscsi-scst/kernel/patches/put_page_callback-2.6.18.1.patch
# patch -p1 < /root/scst/scst/kernel/scst_exec_req_fifo-2.6.18.patch
Compilar la imagen del kernel:
# make clean
#make && make modules
#make modules_install && make install
Comprobar que ha creado entrada el el grub de nuevo kernel vmlinuz-2.6.18-prep
:
# cat /boot/grub/menu.lst
(…)
title CentOS (2.6.18-prep)
root (hd0,0)
kernel /vmlinuz-2.6.18-prep ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-prep.img
Reiniciar sistema con nuevo kernel y comprobarlo:
# uname -a
Linux centos.ferras.local 2.6.18-prep #1 SMP Thu May 20 21:13:48 CEST 2010 x86_64 x86_64 x86_64 GNU/Linux
Crear e instalar módulo scst:
#cd /root/scst
#make scst scst_install iscsi iscsi_install scstadm scstadm_install
3.- Compilar proyecto mhvtl
Documentación:
Proyecto Linux Virtual Tape Library
Procedimiento:
Descargar proyecto mhvl en formato tgz desde aquí, se ha elegido la versión de desarrollo mhvtl-2010-05-08 (0.18-7):
# wget http://sites.google.com/site/linuxvtl2/mhvtl-2010-05-08.tgz?attredirects=0
Descomprimir y compilar:
# tar xzvf mhvtl-2010-05-08.tgz
# cd mhvtl-0.18/
# make distclean
# cd kernel
# make
# make install
# cd ..
#make
# make install
4.- Configurar dispositivos para mhvtl
Documentación:
Procedimiento:
En el foro de nimsa se ha publicado un script para la creación automática de los ficheros de configuración iscsi-scstd.conf y scst.conf. De esta forma crea una configuración particular de librerías y drives emulados por iSCSI:
[root@centos ~]# cat make_scst_config.sh
#!/bin/ksh
# Customize your own
IQN=iqn.2010-05.es.ferras
# Build /etc/iscsi-scstd.conf
lsscsi -g | grep -e tape -e mediumx| awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each; do
echo "Target $IQN:$each" >>/tmp/iscsi-scstd.tmp
done
if [ -f /etc/iscsi-scstd.conf ]; then
cp -f /etc/iscsi-scstd.conf /etc/iscsi-scstd.conf_`date +%m%d%y%H%M%S`
echo Created backup of existing /etc/iscsi-scstd.conf as /etc/iscsi-scstd.conf_`date +%m%d%y%H%M%S`
fi
cat /tmp/iscsi-scstd.tmp >/etc/iscsi-scstd.conf
echo Created new /etc/iscsi-scstd.conf
rm -f /tmp/iscsi-scstd.tmp
echo ——-
# Build /etc/scst.conf
echo "[HANDLER changer]" >/tmp/scst.tmp
lsscsi -g| grep mediumx | awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each1; do
echo DEVICE $each1 >>/tmp/scst.tmp
done
echo "[HANDLER tape]" >>/tmp/scst.tmp
lsscsi -g| grep tape | awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1 | while read each2; do
echo DEVICE $each2 >>/tmp/scst.tmp
done
lsscsi -g | grep -e tape -e mediumx|awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each3; do
echo "[GROUP Default_$IQN:$each3]" >>/tmp/scst.tmp
done
lsscsi -g | grep -e tape -e mediumx| awk '{print $1}'| cut -d "[» -f2| cut -d «]" -f1| while read each4; do
echo "[ASSIGNMENT Default_$IQN:$each4]" >>/tmp/scst.tmp
echo "DEVICE $each4,0" >>/tmp/scst.tmp
done
if [ -f /etc/scst.conf ]; then
cp -f /etc/scst.conf /etc/scst.conf_`date +%m%d%y%H%M%S`
echo Created backup of existing /etc/scst.conf as /etc/scst.conf_`date +%m%d%y%H%M%S`
fi
cat /tmp/scst.tmp >/etc/scst.conf
echo Created new /etc/scst.conf
rm -f /tmp/scst.tmp
echo — Done —
Ejecutarlo:
# sh make_scst_config.sh
Arrancar mhvtl:
/etc/init.d/mhvtl start
Cargar los módulos scst:
modprobe scst
modprobe scst_tape
modprobe scst_changer
Si hemos llegado hasta aquí sin errores deberíamos ver los nuevos dispositivos SCSI del sistema:
# lsscsi
[0:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda
[1:0:0:0] mediumx SPECTRA PYTHON 550V –
[1:0:1:0] tape IBM ULT3580-TD4 550V /dev/st0
[1:0:2:0] tape IBM ULT3580-TD4 550V /dev/st1
[1:0:3:0] tape IBM ULT3580-TD4 550V /dev/st2
[1:0:4:0] tape IBM ULT3580-TD4 550V /dev/st3
[1:1:0:0] mediumx SPECTRA PYTHON 550V –
[1:1:1:0] tape IBM ULT3580-TD4 550V /dev/st4
[1:1:2:0] tape IBM ULT3580-TD4 550V /dev/st5
[1:1:3:0] tape IBM ULT3580-TD4 550V /dev/st6
[1:1:4:0] tape IBM ULT3580-TD4 550V /dev/st7
# cat /proc/scsi_tgt/scsi_tgt
Device (host:ch:id:lun or name) Device handler
0:0:0:0 dev_disk
1:0:1:0 dev_tape
1:0:2:0 dev_tape
1:0:3:0 dev_tape
1:0:4:0 dev_tape
1:1:1:0 dev_tape
1:1:2:0 dev_tape
1:1:3:0 dev_tape
1:1:4:0 dev_tape
1:0:0:0 dev_changer
1:1:0:0 dev_changer
Una comprobación de que los targets iSCSI están correctamente levantados puede ser la siguiente: Desde un Windows XP con el initiator iSCSI instalado se hace un scan a la IP del servidor mhvtl. Se deberán detectar todos los dispositivos iSCSI:
Y desde el Administrador de dispositivos:
Marvelous, what a weblog it is! This weblog provides
valuable data to us, keep it up.
My web-site – judi slot
Highly energetic post, I enjoyed that bit. Will there be a part 2?
Piece of writing writing is also a fun, if you know afterward
you can write if not it is complicated to write.
No matter if some one searches for his essential
thing, so he/she wishes to be available that in detail, thus
that thing is maintained over here.
Good day! This is kind of off topic but I need some guidance from an established blog.
Is it hard to set up your own blog? I’m not very techincal but I
can figure things out pretty quick. I’m thinking about setting up my own but I’m not sure where to start.
Do you have any points or suggestions? Thank you
Very nice post. I simply stumbled upon your blog and wished to mention that I’ve truly enjoyed surfing around your blog posts.
In any case I will be subscribing in your feed and I hope you write again soon!
Superb blog! Do you have any helpful hints for aspiring
writers? I’m planning to start my own blog soon but I’m a little lost on everything.
Would you suggest starting with a free platform like WordPress or go for a paid option?
There are so many choices out there that I’m completely
confused .. Any tips? Many thanks!
Very good blog! Do you have any tips and hints for aspiring writers?
I’m planning to start my own site soon but I’m a little
lost on everything. Would you suggest starting
with a free platform like WordPress or go for a paid option? There are so many options out there
that I’m totally confused .. Any recommendations? Many thanks!
hello there and thank you for your information – I’ve definitely picked up something new from right
here. I did however expertise several technical issues using this site, as I experienced to reload the website
lots of times previous to I could get it to load properly.
I had been wondering if your hosting is OK?
Not that I’m complaining, but sluggish loading instances times will sometimes affect your placement in google and can damage your quality
score if advertising and marketing with Adwords.
Well I’m adding this RSS to my email and could look out for a
lot more of your respective interesting content. Ensure that you update this again soon.
Yes! Finally something about https://public.sitejot.com/beamgallon8.html.
This is very fascinating, You are a very professional blogger.
I’ve joined your rss feed and look ahead to searching for more of
your magnificent post. Also, I have shared your web site in my social networks
Appreciate the recommendation. Let me try it out.
I am regular reader, how are you everybody? This article posted at this web site is
truly pleasant.
You actually make it appear so easy together with your presentation however I to find this topic to be actually one thing that I believe I might by no means understand.
It seems too complex and very huge for me. I am having a look forward for your next post, I’ll attempt to get the dangle of it!
Hello I am so grateful I found your webpage, I really
found you by accident, while I was searching on Google for something
else, Nonetheless I am here now and would just like to say thanks for a remarkable post and
a all round enjoyable blog (I also love the theme/design), I don’t have time to go
through it all at the moment but I have book-marked it
and also included your RSS feeds, so when I have time
I will be back to read much more, Please do
keep up the excellent work.
Wonderful goods from you, man. I’ve understand your stuff previous to and
you’re just extremely magnificent. I really like what you’ve acquired here, really
like what you are saying and the way in which you say it.
You make it entertaining and you still care for to keep it smart.
I can not wait to read much more from you. This is really a wonderful site.
Every weekend i used to go to see this web page, for the reason that i wish for enjoyment, as this this web page conations truly nice funny material too.
I’m really enjoying the design and layout of your blog.
It’s a very easy on the eyes which makes it much more enjoyable for me to
come here and visit more often. Did you hire out a developer to
create your theme? Superb work!
This design is steller! You most certainly know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job.
I really enjoyed what you had to say, and more than that, how you
presented it. Too cool!
This is a topic that is close to my heart… Cheers! Exactly where are your contact details though?
bookmarked!!, I love your blog!
Hi, Neat post. There is an issue together with your web
site in web explorer, would test this? IE nonetheless is the marketplace leader and a large portion of folks will omit
your magnificent writing due to this problem.
Everyone loves it when folks come together and share views.
Great site, keep it up!
My blog post: judi slot
After I originally left a comment I seem to have clicked on the -Notify me when new
comments are added- checkbox and from now on each time a comment is added I recieve
four emails with the exact same comment.
Is there an easy method you can remove me from that service?
Thanks!
Hi Dear, are you truly visiting this web page regularly,
if so after that you will without doubt take pleasant know-how.
What’s up, this weekend is pleasant designed for me, since
this point in time i am reading this great informative post here at my residence.
Greate pieces. Keep writing such kind of information on your
blog. Im really impressed by your blog.
Hey there, You have done a fantastic job. I will
certainly digg it and in my opinion recommend to my friends.
I’m sure they will be benefited from this web site.
Outstanding quest there. What occurred after? Good luck!
Nice post. I learn something new and challenging on sites I stumbleupon on a daily basis.
It’s always useful to read through content from other writers and use something from other websites.
Superb blog! Do you have any helpful hints for aspiring writers?
I’m hoping to start my own blog soon but I’m a
little lost on everything. Would you suggest starting with
a free platform like WordPress or go for a paid option? There are so many options out there that I’m totally confused ..
Any tips? Cheers!
Piece of writing writing is also a fun, if you know after that you can write or else it is
complex to write.
You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand.
It seems too complicated and very broad for me.
I’m looking forward for your next post, I will try to
get the hang of it!
You are so cool! I do not think I’ve read anything like that before.
So great to find somebody with a few genuine thoughts on this subject.
Seriously.. thank you for starting this up. This site is something
that is needed on the internet, someone with a little originality!
Superb, what a web site it is! This weblog provides valuable
information to us, keep it up.
Wonderful article! That is the type of information that should be shared
across the internet. Disgrace on the seek engines for now not positioning
this publish higher! Come on over and consult with my website
. Thank you =)
Everything is very open with a clear description of the issues.
It was definitely informative. Your site is very useful.
Thank you for sharing!
Thanks to my father who stated to me regarding this website, this web site
is actually awesome.
I am regular visitor, how are you everybody? This paragraph posted at this site is genuinely nice.
There is definately a lot to know about this subject. I like all of the points you have made.
Here is my website; judi slot deposit pulsa
I need to to thank you for this fantastic read!! I definitely enjoyed every little bit
of it. I have you book-marked to check out new things you post…
Hello, I enjoy reading through your post. I like to write a
little comment to support you.
Link exchange is nothing else except it is just placing the other person’s weblog
link on your page at suitable place and other person will also do same in favor of you.
Good day! Do you know if they make any plugins to safeguard against hackers?
I’m kinda paranoid about losing everything I’ve worked hard
on. Any tips?
I love what you guys are up too. This sort of clever work and exposure!
Keep up the awesome works guys I’ve added you guys to my own blogroll.
My web page judi Slot
I was able to find good info from your blog articles.
I am curious to find out what blog system you have been using?
I’m having some small security problems with my latest site
and I’d like to find something more safeguarded.
Do you have any suggestions?
I used to be able to find good advice from your blog posts.
After I originally commented I appear to have clicked the -Notify me when new
comments are added- checkbox and from now on each time a comment is added I recieve 4 emails with the same
comment. Is there an easy method you can remove me from that service?
Many thanks!
I am curious to find out what blog system you happen to be using?
I’m having some small security issues with my latest blog
and I would like to find something more safe. Do you have any recommendations?
I’ve read some good stuff here. Certainly worth bookmarking for revisiting.
I wonder how a lot effort you put to create this sort of fantastic informative website.