Problem with MHVTL on CentOS5.4

classic Classic list List threaded Threaded
Locked 1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem with MHVTL on CentOS5.4

[nia]
Administrator

Problem with MHVTL on CentOS5.4

Postby JoeMaya » Wed Mar 31, 2010 6:43 pm

I'm trying out the step-by-step guide for installing iSCSI + MHVTL on CentOS. I'm got stuck at a point when preparing the source rpm files. First when I run the command;

rpm -ivh http://mirror.centos.org/centos/5/updat ... l5.src.rpm

once the download is over and the install starts, I get the following msgs repeated.

warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root


After that I run the command:

cd ~/rpmbuild/SPECS
rpmbuild -bp --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log



but I do not find the source files in rpmbuild/BUILD. I guess the reason might be due to the messages I get when installing the kernel rpm, since "nia" advised in the guide against building the package as root, whereas the message indicates that the mockbuild does not exist due to which the install is using root. I did try creating a user called mockbuild after which I didn't get the message I got above, but I still do not see the source files in rpmbuild/BUILD.

So anyone got any ideas what I should be doing?
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby nia » Wed Mar 31, 2010 10:14 pm

These instruction is from http://wiki.centos.org/HowTos/I_need_the_Kernel_Source

Try again, see below .. The warning messages maybe fine. I have gotten those also because I did not have the "grep -v mockb"


----------------------------------------

2.1. CentOS 4 and 5
As root, install the packages rpm-build, redhat-rpm-config and unifdef: 


[root@host]# yum install rpm-build redhat-rpm-config unifdef

As an ordinary user, not root, create a directory tree based on ~/rpmbuild: 
[user@host]$ cd
[user@host]$ mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
[user@host]$ echo '%_topdir %(echo $HOME)/rpmbuild' > .rpmmacros


You are strongly advised against package building as root. (See: Building Source RPM as non-root under CentOS) 

Find the kernel source rpm in: 

http://mirror.centos.org/centos/5/updates/SRPMS/ (Current Updates/SRPMS) 

http://mirror.centos.org/centos/5/os/SRPMS/ (Current OS/SRPMS) 

(Replace the "5" with a "4" for CentOS-4 kernels) 

http://vault.centos.org/ (CentOS Vault) 

(Pick either <version>/updates/SRPMS or <version>/os/SRPMS) 

Once you have located the source file, you can install it by running, for example: 


[user@host]$ rpm -i http://mirror.centos.org/centos/5/updat ... l5.src.rpm 2>&1 | grep -v mockb


Now that the source rpm is installed, unpack and prepare the source files: 


[user@host]$ cd ~/rpmbuild/SPECS

[user@host SPECS]$ rpmbuild -bp --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log

The value of `uname -m` (note: back ticks (grave accents) not single quotation marks (apostrophies)) sets --target to the architecture of your current kernel. This is generally accepted and most people will have either i686 or x86_64. 

The kernel source tree will now be found in the directory ~/rpmbuild/BUILD/.
~nia
nia
Forum Founder
 
Posts: 273
Joined: Sat Dec 12, 2009 12:51 pm
Location: USA

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 8:24 am

Hi Nia,

I tried it out again, but it isn't working out with me. Basically after I do everything as mentioned, I do not find anything in the BUILD directory. This is what I get:


[root@vtl-x64 ~]# su - vtl
[vtl@vtl-x64 ~]$ cd ~/rpmbuild/SPECS/
[vtl@vtl-x64 SPECS]$ ls
kernel-2.6.spec prep-err.log prep-out.log
[vtl@vtl-x64 SPECS]$ rpmbuild -bp --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log
Building target platforms: x86_64
Building for target x86_64
[vtl@vtl-x64 SPECS]$ cd ..
[vtl@vtl-x64 rpmbuild]$ cd BUILD/
[vtl@vtl-x64 BUILD]$ ls
[vtl@vtl-x64 BUILD]$


Got any ideas what's is happening?
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 10:04 am

OK, I tried doing it again, and same issue. But I noticed something this time, when we run the following:

rpmbuild -bp --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log


We are creating two log files, the prep-err.log which I assume is for logging any errors and the prep-out.log which again i'm assuming is for logging the output result of the command. Anyways, when I open the prep-err.log file, I find the following in it:

error: Failed build dependencies:
gcc >= 3.4.2 is needed by kernel-2.6.18-164.15.1.el5.x86_64


So when i did an rpm -qa |grep gcc, found that I didn't have it installed. So I ran yum install gcc and installed it. Now I'm running the rpmbuild command and my system is busy building the kernel. So I guess problem is solved. So if anyone has a problem during the rpmbuild process they should look into the prep-err.log file to see what the error is.

Hopefully it's smooth sailing from here. If not, I'll be posting update again :D
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby nia » Mon Apr 05, 2010 5:11 pm

Yes, I was going to suggest to check the log files next .. Looks like you have figured it out already ;)
~nia
nia
Forum Founder
 
Posts: 273
Joined: Sat Dec 12, 2009 12:51 pm
Location: USA

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 5:42 pm

Ok, I've managed to build the kernel but am not stuck at the following:

[root@vtl-x64 2.6.18-164.el5]# cd /root/scst
[root@vtl-x64 scst]# make scst scst_install iscsi iscsi_install scstadm scstadm_install
cd scst && make all
make[1]: Entering directory `/root/scst/scst'
cd src && make all
make[2]: Entering directory `/root/scst/scst/src'
make -C /lib/modules/2.6.18-164.el5/build SUBDIRS=/root/scst/scst/src BUILD_DEV=m
make: Entering an unknown directory
make: *** /lib/modules/2.6.18-164.el5/build: No such file or directory. Stop.
make: Leaving an unknown directory
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/scst/scst/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/scst/scst'
make: *** [scst] Error 2
[root@vtl-x64 scst]#


If I go to /lib/modules/2.6.18-164.el5/ there is no build directory. I tried installing the kernel-devel "yum install kernel-devel" and my kernel details are as follows:

[root@vtl-x64 scst]# rpm -qa |grep kernel
kernel-headers-2.6.18-164.15.1.el5
kernel-2.6.18-164.el5
kernel-devel-2.6.18-164.15.1.el5
[root@vtl-x64 scst]# uname -a
Linux vtl-x64.lab.com 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@vtl-x64 scst]#

So what should I be doing from here?

I'm ending up learning linux building the vtl :roll:
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby root » Mon Apr 05, 2010 5:58 pm

[root@vtl-x64 scst]# rpm -qa |grep kernel
kernel-headers-2.6.18-164.15.1.el5
kernel-2.6.18-164.el5
kernel-devel-2.6.18-164.15.1.el5
[root@vtl-x64 scst]# uname -a
Linux vtl-x64.lab.com 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@vtl-x64 scst]#


Are you on the new patched kernel ?

>download kernel source
>Build kernel source
>Copy kernel source to /usr/kernel/..
>Patch your kernel with scst patches
>make && make modules && make modules_install && make install
> Reboot and come up with new patched kernel
>make scst scst_install iscsi iscsi_install scstadm scstadm_install
Root
Forum Moderator
User avatar
root
Forum Global Moderator
 
Posts: 45
Joined: Sun Mar 28, 2010 3:11 pm

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 6:09 pm

Yes I am. I following all your instructions, patched it, rebooted and ran the install.

Anyways, I tried another thing, I linked it to the source files and then ran it and it worked. Everything worked fine and no errors were logged. I've even installed the mhvtl-0.18-5. Started the mhvtl and it's working fine.

[root@vtl-x64 mhvtl-0.18]# lsscsi -g
[0:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda /dev/sg0
[1:0:0:0] mediumx SPECTRA PYTHON 550V - /dev/sg8
[1:0:1:0] tape IBM ULT3580-TD4 550V /dev/st0 /dev/sg1
[1:0:2:0] tape IBM ULT3580-TD4 550V /dev/st1 /dev/sg2
[1:0:3:0] tape IBM ULT3580-TD4 550V /dev/st2 /dev/sg3
[1:0:4:0] tape IBM ULT3580-TD4 550V /dev/st3 /dev/sg4
[1:1:0:0] mediumx SPECTRA PYTHON 550V - /dev/sg10
[1:1:1:0] tape IBM ULT3580-TD4 550V /dev/st7 /dev/sg9
[1:1:2:0] tape IBM ULT3580-TD4 550V /dev/st4 /dev/sg5
[1:1:3:0] tape IBM ULT3580-TD4 550V /dev/st5 /dev/sg6
[1:1:4:0] tape IBM ULT3580-TD4 550V /dev/st6 /dev/sg7


But now when I go back to scst, i'm getting an error:

[root@vtl-x64 /]# cd /root/scst
[root@vtl-x64 scst]# modprobe scst
FATAL: Module scst not found.
[root@vtl-x64 scst]# modprobe scst_tape
FATAL: Module scst_tape not found.
[root@vtl-x64 scst]# modprobe scst_changer
FATAL: Module scst_changer not found.

What am I missing? The scst installation went fine with no errors logged.
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby root » Mon Apr 05, 2010 6:24 pm

Can you verify that you are running on the new patched kernel ?





Code: Select all
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
make clean
make && make modules
make modules_install && make install



Check your /boot/grub/menu.lst, it should look like this:

Code: Select all

#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
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
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-164.el5.img




Reboot you system now. Make sure you come back on the new kernel that is called vmlinuz-2.6.18-prep.

Once the system comes back, verify that you are running on the new kerenl:
# uname -a
Linux xxxx.xxxx 2.6.18-prep #1 SMP Mon Mar 15 16:56:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

Root
Forum Moderator
User avatar
root
Forum Global Moderator
 
Posts: 45
Joined: Sun Mar 28, 2010 3:11 pm

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 6:49 pm

Yeah, you are right, I just noticed I'm still on the old kernel.

[root@vtl-x64 ~]# uname -a
Linux vtl-x64.lab.com 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@vtl-x64 ~]#


What's the step for making 2.6.18-prep the default, since it's not covered in the step by step guide?
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 6:58 pm

If you are talking about having the vmlinuz-2.6.18-prep file in the /boot folder, it is already there. And regaring the grub config file, this is how it looks like:

#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
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
title CentOS (2.6.18-164.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-164.el5.img


So what do I do from here?

======================

OK, I think I figured it out. Basically it gives me a boot menu which I never noticed. selecting the proper one booted me into that kernel. What I've done with the grub.conf file, is commented out the 2.6.18-164 kernel, so it by default boots into the patched kernel. So that's sorted out, but do I have to redo the steps starting from rebooting the system?

=========================

Ok, I re-did the steps after the reboot and everything seems fine. Install the scst install seemed much better this time. Last time I got some warnings but no errors, this time no warnings either.

I just finished installing mhvtl and ran lsscsi -g to see my library and I'm noticing that it's showing me disks this time rather then tapes :shock: 

[root@vtl-x64 mhvtl-0.18]# lsscsi -g
[0:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda /dev/sg0
[1:0:0:0] disk d-linux- x86-64.so.2 à¹. /dev/sdj /dev/sg9
[1:0:1:0] disk d-linux- x86-64.so.2 _uid /dev/sdb /dev/sg1
[1:0:2:0] disk d-linux- x86-64.so.2  > /dev/sdc /dev/sg2
[1:0:3:0] disk d-linux- x86-64.so.2 ° /dev/sdd /dev/sg3
[1:0:4:0] disk > /dev/sde /dev/sg4
[1:1:0:0] disk d-linux- x86-64.so.2 > /dev/sdk /dev/sg10
[1:1:1:0] disk d-linux- x86-64.so.2 Ð> /dev/sdf /dev/sg5
[1:1:2:0] disk d-linux- x86-64.so.2 subs /dev/sdg /dev/sg6
[1:1:3:0] disk d-linux- x86-64.so.2 @> /dev/sdh /dev/sg7
[1:1:4:0] disk d-linux- x86-64.so.2 P> /dev/sdi /dev/sg8
[root@vtl-x64 mhvtl-0.18]#

Any ideas? I did the same steps as before, the only difference is the patched kernel :cry:
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby root » Mon Apr 05, 2010 7:51 pm

You have to redo installing MHVTL STEP on the new Kernel. Just re-compile and re-install mhvtl again so mhvtl kernel module can load in the new kernel.
Root
Forum Moderator
User avatar
root
Forum Global Moderator
 
Posts: 45
Joined: Sun Mar 28, 2010 3:11 pm

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Mon Apr 05, 2010 8:18 pm

OK, I followed these steps from an earlier reply by you in a previous topic I had started
---------------------------
/etc/init.d/mhvtl stop
/etc/init.d/mhvtl shutdown
rmmod mhvtl -f # if you have to.

This is to be sure that no mhvtl module loaded in the kernel.

Now go back to `/root/mhvtl-0.18/kernel'

make clean
make
make install
----------------------

But I still am getting the same results. I ran dmesg to look for errors and found tons of errors there. Following is an example of the errors I'm getting:

mhvtl: fill_from_user_buffer[110] failed to copy_from_user()
sdk: Write Protect is off
sdk: Mode Sense: 00 00 00 00
end_request: I/O error, dev sdj, sector 2097144
sdk: cache data unavailable
sdk: assuming drive cache: write through
sdk:end_request: I/O error, dev sdj, sector 2097144
end_request: I/O error, dev sdk, sector 0
end_request: I/O error, dev sdj, sector 2097144
end_request: I/O error, dev sdk, sector 0
end_request: I/O error, dev sdj, sector 2097088
end_request: I/O error, dev sdk, sector 0
end_request: I/O error, dev sdj, sector 2097136
end_request: I/O error, dev sdk, sector 0
end_request: I/O error, dev sdj, sector 2097144
end_request: I/O error, dev sdk, sector 0
end_request: I/O error, dev sdj, sector 2097144
end_request: I/O error, dev sdk, sector 0
end_request: I/O error, dev sdj, sector 0
end_request: I/O error, dev sdk, sector 0
Dev sdk: unable to read RDB block 0


It's as if it's having issue with the hard drive, though it's a VM.

Is it just me or has anyone else gone through so much trouble getting this up? :cry: Oh well, at least I'm learning linux:P
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby root » Mon Apr 05, 2010 8:45 pm

Can you check your System.map, make sure it is the correct one: i.e
/boot/System.map -> /boot/System.map-2.6.18-prep
Root
Forum Moderator
User avatar
root
Forum Global Moderator
 
Posts: 45
Joined: Sun Mar 28, 2010 3:11 pm

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Tue Apr 06, 2010 6:56 pm

yes, it is available and the linking is there.
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby root » Tue Apr 06, 2010 10:20 pm

Sorry, not sure what is next. Hopefully some one else can help. It maybe faster to redo everything in a new vm session ..
Root
Forum Moderator
User avatar
root
Forum Global Moderator
 
Posts: 45
Joined: Sun Mar 28, 2010 3:11 pm

Re: Problem with MHVTL on CentOS5.4

Postby JoeMaya » Thu Apr 08, 2010 8:12 am

Yeah, that's what I had done that night. I re-built the entire machine from scratch and it's working fine now. The various solutions given to me during this course did prove helpful, because when I re-built the machine, it was smooth sailing with no glitches and I was done in like 4-5 hours :D 

Thanks Nia and Root for the help!!! I got my VTL up and running in BE 2010 :D
JoeMaya
Member
 
Posts: 19
Joined: Wed Mar 24, 2010 9:34 am

Re: Problem with MHVTL on CentOS5.4

Postby root » Fri Apr 09, 2010 1:36 am

I am glad it is working for you now. Have fun testing BE 2010 ;)
Root
Forum Moderator
User avatar
root
Forum Global Moderator
 
Posts: 45
Joined: Sun Mar 28, 2010 3:11 pm