Newbie Question: Using modprobe and a SCSI controller

pwharff

Registered
At my job we do validation (testing) and we constantly are swapping out different SCSI controllers to perform RAID stress tests, however the only way that we have discovered to get the OS to recognize the new controller and it's drives is to re-install.

Someone hinted to me that I needed to use modprobe, so I looked up the man page and have tried different commands attempting to recognize the card. Here's what I've tried so far:


modprobe /lib/modules/2.4.18-14smp/kernel/drivers/scsi/qla1280.o

modprobe qla1280.o

modprobe -t qla1280.o

modprobe \*

modprobe /lib/modules/2.4.18-14smp/kernel/drivers/scsi/*


And most of the time I get an error like: "Can't locate module". Also, everytime I do any of the commands above, I try "lsmod" and do not see my card loaded.

Any help would be appreciated. I'm using Red Hat linux 8.0.
 
The proper syntax for the example you cited would be 'modprobe qla1280' - without the .o extension. AFAIK, the driver will not show up in lsmod unless the driver detects the hardware correctly. Either way, you can tail /var/log/messages to check what happens when you try to load up the module, which should give some detail as to what's going on.

Hope this helps...

(btw, given this is a MacOSX forum, I'm not sure how well Linux questions fit here, but I'm happy to help if I can... :) )
 
Thanks for your knowledge! I will try this.

but I'm happy to help if I can...

Thanks for the offer and yes I could use your help. I am Mac user but I'm not aware of many UNIX resources like MacOSX.com but for UNIX/Linux. Do you know of any good resources, bbs, or forums?
 
I did modprobe qla1280 and it worked! And even showed up in lsmod. However it doesn't show up when I reboot and dis-appears from lsmod. How do I get this to work PROPERLY during boot time?

Basically it says: "Finding Module Dependencies" and then throws me an error about an non-consistent superblock with /dev/md0 /dev/md1 /dev/md2. Do I need to add something to one of the rcX.d directories?
 
Getting it to come up at boot time involves adding a line for the driver in /etc/modules.conf. I'm a little sketchy about exactly how to determine the right alias name to use, though. I'm actually fighting this with my soundcard, which works if I manually start it, but not with the entry in modules.conf. Alternately, you could look at adding a line in /etc/rc.d/rc.local to run the modprobe.

A friend of mine recently asked me in email about Linux documentation resources (which caught me a bit by surprise; he's a self-described Windows-bigot) so he could play with RH8 in VMWare. I sent him the following links:

http://www.linux.org/docs/index.html
http://www.tldp.org/
http://www.linuxdocs.org/
http://www.redhat.com/docs/

I need to spend some time with these myself, to sort out the soundcard issue, among other things.
 
Thanks again for your help. I spent most of yesterday checking out some of the sites you mentioned. I learned a lot about modprobe and more in detail how RAIDS work too. However I still haven't found the solution to the second part of my problem and that is the system doesn't fully boot. Basically I made some startup scripts:

/sbin/modprobe qla1280

/sbin/raidstart --all

/bin/mount -a

Now this script works if I rename the /etc/raidtab , comment-out the scsi disks in /etc/fstab , reboot the system then rename the /etc/raidtab back to it's original name and comment-in the scsi disks in /etc/fstab. This get's Red Hat back up to it's original state (x11 gnome). Then I run the script above, it works and I can now access the SCSI disks via the controller.

What the frick could possibly be stopping it from booting fully. BTW, I tried putting the above startup script in rc1.d and rc3.d and it no worky! :mad:
 
It should work in either rc1.d or rc3.d. Of these two, I'd go with rc3.d. But, really, I think /etc/rc.d/rc.local would be the best place to put these commands. rc.local is the last thing called during startup, after all the other rcx.d scripts.

If you choose to stick with rc3.d... How are you naming the script in the directory? The name of the script (and its contents) are important. Specifically, the name of the script must be in the form of 'S99somescript'. For the first character, you can have either 'S' (start) or 'K' (kill). Obviously, you want to start. The next 2 characters ('99' above) allows you to define order. So, S01 gets executed first, then S02, etc.. The rest is the descriptive name for the script and can be whatever you want. If the script is simply named 'somescript' in the rcx.d directory, the system ignores it. If you do it this way, I'd recommend that it be an 'S98', which would run next-to-last, before local.

Also, the script will be passed a single parameter - 'start' if it is placed and named properly, but that may not matter here, since you're already assuming that if it gets called, you want the behaviour to be 'start'. The passing of the parameter is fairly standard - as $1 within the script. Have a look at some of the other start scripts to see how this is normally handled.

Again, rc.local is what I'd be doing if I were you, but regardless, let us know how you get on with this... :)
 
WOW, thanks for all the useful information. I was wondering about the 'S' and 'K'. I tried rc.local and it doesn't work because the system never even gets to rc.local and I don't think it even gets to rc3.d? I'm not sure where "Finding Module Dependencies" is in the runlevel, but I thinks it's in rc2.d or rc3.d? This is why my problem is such a big frickin problem, I have to make sure to probe, start and mount before the system checks the raidtab and fstab files and throws me an error. I think your solution will work. I'm not at work now (at home on my Mac :D ), but I'll definately try it on Monday. Thanks again for all your help. It's people like you that makes UNIX/Linux all worth it!
 
Ok, I finally got a chance to try your suggestions. I renamed my script to S99modules and still I cannot boot. Then I discovered that I could use a command called "chkconfig" to automatically configure the run-level scripts for the rcX.d directories. The command worked great but I still wasn't able to boot. I finally decided to give up and just write a simple shell script, I created two scripts: 1) fix_raid AND 2) added to the rc.loal

Here's what my scripts look like, let me know what you think:

fix_raid

#!/bin/bash

#
# Find out if fstab.custom exists, if not creat it

if [ -f /etc/fstab.custom ] ; then
echo "fstab.custom already exists"
else
echo "LABEL=/ / ext3 defaults 1 1" >> /etc/fstab.custom
echo "LABEL=/boot /boot ext3 defaults 1 2" >> /etc/fstab.custom
echo "#/dev/md0 /d1 ext3 defaults 1 2" >> /etc/fstab.custom
echo "#/dev/md1 /d2 ext3 defaults 1 2" >> /etc/fstab.custom
echo "#/dev/md2 /d3 ext3 defaults 1 2" >> /etc/fstab.custom
echo "none /dev/pts devpts gid=5,mode=620 0 0" >> /etc/fstab.custom
echo "none /proc proc defaults 0 0" >> /etc/fstab.custom
echo "none /dev/shm tmpfs defaults 0 0" >> /etc/fstab.custom
echo "/dev/hda3 swap swap defaults 0 0" >> /etc/fstab.custom
echo "/dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0" >> /etc/fstab.custom
echo "/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0" >> /etc/fstab.custom
fi

#
# Find out if fstab.original exists

if [ -f /etc/fstab.original ] ; then
echo "fstab.original already exists"
else
mv /etc/fstab /etc/fstab.original
cp /etc/fstab.custom /etc/fstab
fi

#
# Find out if raidtab.original exists

if [ -f /etc/raidtab ] ; then
mv /etc/raidtab /etc/raidtab.original
else
echo "raidtab.original already exists"
fi

/sbin/reboot

rc.local

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.


#
# Start RAID's

if [ -f /etc/fstab.original ] ; then
rm -f /etc/fstab
mv /etc/fstab.original /etc/fstab
mv /etc/raidtab.original /etc/raidtab
/sbin/modprobe qla1280
/sbin/raidstart --all
/bin/mount -a
else
echo "RAID driver not installed, check /etc/rc.d/rc.local and make sure that modprobe scsi_driverXXXX is correct" >> /var/log/messages
fi
 
Ok, well maybe should I say that someone else helped me figure it out! It was simple, all I had to do was add the line /sbin/modprobe qla1280 to the file /etc/rc.modules

NOTE: I had to create the file rc.modules and make it executable.

THANKS SO MUCH FOR YOUR HELP!!!

BTW, I found my answer on Google Linux Group

--Paul
 
Back
Top