Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Drivers

Working with Linux Driver Modules

Submitted by on December 22, 2009 – 6:57 pm 2 Comments

You just replaced a failed network card, rebooted your server and now network wouldn’t start and your screen is filled with cryptic error messages about some kernel module doing something it’s not supposed to do. This usually happens on Fridays or a day before you leave on vacation. Below is a summary of some basic Linux commands that can help you to quickly troubleshoot many driver/module-related problems.

First things first: whenever you add new hardware, replace failed hardware, or upgrade firmware, almost always you must install the drivers first. When that new disk controller is in and the system is booting up, it usually helps to have the correct driver already installed. How do you know that a specific module is loaded? Linux hides this information in /proc/modules. Let’s say you are looking for NFS-related modules:

icebox:~ # egrep "^nfs|^lockd" /proc/modules

      nfsd 211612 13 - Live 0xfa716000
      lockd 61748 1 nfsd, Live 0xf97e7000
      nfs_acl 2848 1 nfsd, Live 0xf9418000

Another way of getting the same information is by using the “lsmod” command:

icebox:~ # lsmod | egrep "^nfs|^lockd"

      nfsd                  211612  13
      lockd                  61748  1 nfsd
      nfs_acl                 2848  1 nfsd

Use the “modinfo” command to get a little bit more detail about the module that’s causing your headache:

icebox:~ # modinfo nfsd

      filename:       /lib/modules/2.6.27.7-9-pae/kernel/fs/nfsd/nfsd.ko
      license:        GPL
      author:         Olaf Kirch 
      srcversion:     E6DFAD8170CEA2285A8E64C
      depends:        auth_rpcgss,sunrpc,lockd,exportfs,nfs_acl
      supported:      yes
      vermagic:       2.6.27.7-9-pae SMP mod_unload modversions 586

The particularly useful feature of the “modinfo” command is the list of dependencies. Here is a simple script that will “modinfo” the module of your choice and then check to make sure all dependent modules are loaded:

for module in `modinfo nfsd | grep depends | awk '{print $2}' | sed 's/,/ /g'`
do
	if [ `egrep -c "^${module} " /proc/modules` -gt 0 ]
	then
		egrep "^${module} " /proc/modules
	else
		echo "ERROR: dependednt module $module not found in /proc/modules"
	fi
done

If you have a driver module that is interfering with another module, you can unload one of them using “rmmod” command. You can use the “insmod” command to insert a module into the system kernel.

Perhaps a better way of removing (and adding) modules is by using the “modprobe” command. A cool feature of this command is the “–dry-run” option, which allows you to test adding/removing modules without actually adding or removing them. This is great if you have a production server that you don’t want to mess up (just yet).

If you support SLES systems and have the misfortune of dealing with Novell’s tech support, there is one tidbit of information you may find useful. Staring with SLES 11 any modules not directly supported by Novell will not load unless the /etc/modprobe.d/unsupported-modules file has this entry: allow_unsupported_modules 1

Print Friendly, PDF & Email

2 Comments »

  • Kobe says:

    I need the driver for my Belkin N150 F6D4050 v2 for my Linux Mint installation.

    I know its probably one of these
    http://www.ralinktech.com/support.php?s=2

    But I can’t figure out witch one.

    Thanks in advance.

  • Victoria T says:

    I am after opinions on Vista please. I am buyig a new pc with it on, not upgrading.

    I have checked what i need to do with BT if the software doesnt work. I use AVG and zone alarms, and they seem to work ok with it.

    What is the general view of Vista please?
    Will windows 2003 work with it?

    I am also planning on getting a 2gb RAM PC as I have heard it takes up about 500 mb just to run the operating system.

    thanks
    To clarify I mean office 2003.

    Do (please dont laugh) PC’s come in larger than 2GB RAM? I have had trouble finding one that big. I usually have 5 applications open at a time as well (use it for work).

Leave a Reply

%d bloggers like this: