Product SiteDocumentation Site

Chapter 29. General Parameters and Modules

29.1. Kernel Module Utilities
29.2. Persistent Module Loading
29.3. Specifying Module Parameters
29.4. Storage parameters
29.5. Ethernet Parameters
29.5.1. Using Multiple Ethernet Cards
29.5.2. The Channel Bonding Module
29.6. Additional Resources
This chapter is provided to illustrate some of the possible parameters available for common hardware device drivers [9], which under Fedora are called kernel modules. In most cases, the default parameters do work. However, there may be times when extra module parameters are necessary for a device to function properly or to override the module's default parameters for the device.
During installation, Fedora uses a limited subset of device drivers to create a stable installation environment. Although the installation program supports installation on many different types of hardware, some drivers (including those for SCSI adapters and network adapters) are not included in the installation kernel. Rather, they must be loaded as modules by the user at boot time.
Once installation is completed, support exists for a large number of devices through kernel modules.

29.1. Kernel Module Utilities

A group of commands for managing kernel modules is available if the module-init-tools package is installed. Use these commands to determine if a module has been loaded successfully or when trying different modules for a piece of new hardware.
The command /sbin/lsmod displays a list of currently loaded modules. For example:
~]$ /sbin/lsmod
Module                  Size  Used by
autofs4                25618  3 
sunrpc                231823  1 
bonding               115826  0 
ip6t_REJECT             4641  2 
nf_conntrack_ipv6      19623  2 
ip6table_filter         2895  1 
ip6_tables             19232  1 ip6table_filter
ipv6                  322766  61 bonding,ip6t_REJECT,nf_conntrack_ipv6
dm_mirror              13723  0 
dm_region_hash         11920  1 dm_mirror
dm_log                  9944  2 dm_mirror,dm_region_hash
uinput                  8126  0 
sg                     30478  0 
sr_mod                 16066  0 
snd_ens1370            23085  4 
gameport               10783  1 snd_ens1370
snd_rawmidi            22955  1 snd_ens1370
cdrom                  39833  1 sr_mod
snd_seq                56461  0 
snd_seq_device          6634  2 snd_rawmidi,snd_seq
snd_pcm                83399  1 snd_ens1370
snd_timer              22304  4 snd_seq,snd_pcm
snd                    70077  12 snd_ens1370,snd_rawmidi,snd_seq,snd_seq_device,snd_pcm,snd_timer
virtio_net             15937  0 
i2c_piix4              12707  0 
soundcore               7892  1 snd
joydev                 10514  0 
snd_page_alloc          8604  2 snd_ens1370,snd_pcm
i2c_core               31338  1 i2c_piix4
virtio_balloon          3599  0 
ext4                  362885  2 
mbcache                 7510  1 ext4
jbd2                   98427  1 ext4
virtio_blk              5159  3 
ata_generic             3619  0 
pata_acpi               3675  0 
virtio_pci              6741  0 
virtio_ring             6026  1 virtio_pci
virtio                  4864  4 virtio_net,virtio_balloon,virtio_blk,virtio_pci
ata_piix               22532  0 
dm_mod                 73839  8 dm_mirror,dm_log
The first column lists the names of modules; the second column lists the sizes of the modules, and the third column lists the use counts. The output from the /sbin/lsmod command is less verbose and easier to read than the output of cat /proc/modules.
To load a kernel module, use the /sbin/modprobe command followed by the kernel module name. By default, modprobe attempts to load the module from the /lib/modules/<kernel-version>/kernel/drivers/ subdirectories. There is a subdirectory for each type of module, such as the net/ subdirectory for network interface drivers. Some kernel modules have module dependencies, meaning that other modules must be loaded first for it to load. The /sbin/modprobe command checks for these dependencies and loads the module dependencies before loading the specified module.
For example, the command:
~]# /sbin/modprobe e100

…first loads all module dependencies of the e100 module before loading the e100 module itself.
To print to the screen all commands as /sbin/modprobe executes them, use the -v option. For example:
~]# /sbin/modprobe -v e100

Output similar to the following is displayed:
/sbin/insmod /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko
Using /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko
Symbol version prefix 'smp_'

The /sbin/insmod command can also be used to load kernel modules; however, it does not resolve dependencies. You should thus always use /sbin/modprobe instead of the insmod command to load kernel modules.
To unload kernel modules, use the /sbin/rmmod command followed by the module name. The rmmod utility only unloads modules that are not in use and that are not a dependency of other modules in use.
For example, the command:
~]# /sbin/rmmod e100

…unloads the e100 kernel module.
Another useful kernel module utility is modinfo. Use the command /sbin/modinfo to display information about a kernel module. The general syntax is:
~]# /sbin/modinfo [options]  <kernel_module_name> 

Options include -d, which displays a brief description of the module, and -p, which lists the parameters the module supports. The modinfo command is useful for listing information such as version, dependencies, paramater options, and aliases of modules.For a complete list of options, refer to the modinfo man page.

[9] A driver is software which enables Linux to use a particular hardware device. Without a driver, the kernel cannot communicate with attached devices.