# Newbie Question: Using modprobe and a SCSI controller



## pwharff (Mar 4, 2003)

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.


----------



## kenny (Mar 4, 2003)

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...  )


----------



## pwharff (Mar 4, 2003)

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?


----------



## pwharff (Mar 4, 2003)

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?


----------



## kenny (Mar 5, 2003)

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.


----------



## pwharff (Mar 7, 2003)

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!


----------



## kenny (Mar 7, 2003)

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...


----------



## pwharff (Mar 7, 2003)

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  ), 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!


----------



## pwharff (Mar 10, 2003)

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
> ...



*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
> ...


----------



## actwon (Mar 11, 2003)

Another resource for information is:

http://www.sysadmintalk.com/

It is a good place to ask unix questions of any kind for any falvor of unix.

actwon


----------



## pwharff (Mar 11, 2003)

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


----------

