Team LiB
Previous Section Next Section

Loading Modules

The simplest way to load a module is via insmod. This utility is very basic. It simply asks the kernel to load the module you specify. The insmod program does not perform any dependency resolution or advanced error checking. Usage is trivial. As root, simply run

insmod module

where module is the name of the module that you want to load. To load the fishing pole module, you would run

insmod fishing

In like fashion, to remove a module, you use the rmmod utility. As root, simply run

rmmod module

For example,

rmmod fishing

removes the fishing pole module.

These utilities, however, are trivial and unintelligent. The utility modprobe provides dependency resolution, intelligent error checking and reporting, and more advanced features and options. Its use is highly encouraged.

To insert a module into the kernel via modprobe, run as root

modprobe module [ module parameters ]

where module is the name of the module to load. Any following arguments are taken as parameters to pass to the module on load. See the section "Module Parameters" for a discussion on module parameters.

The modprobe command attempts to load not only the requested module, but also any modules on which it depends. Consequently, it is the preferred mechanism for loading kernel modules.

The modprobe command can also be used to remove modules from the kernel. Again, as root, run

modprobe r modules

where modules specifies one or more modules to remove. Unlike rmmod, modprobe also removes any modules on which the given module depends, if they are unused.

Section eight of the Linux manual pages provides a reference on their other, less used, options.

    Team LiB
    Previous Section Next Section