31.6. Setting Module Parameters
- Load a kernel module by running the
modprobecommand along with a list of customized parameters on the command line. If the module is already loaded, you need to first unload all its dependencies and the module itself using the
modprobe -rcommand. This method allows you to run a kernel module with specific settings without making the changes persistent. See Section 31.6.1, “Loading a Customized Module - Temporary Changes” for more information.
- Alternatively, specify a list of the customized parameters in an existing or newly-created file in the
/etc/modprobe.d/directory. This method ensures that the module customization is persistent by setting the specified parameters accordingly each time the module is loaded, such as after every reboot or
modprobecommand. See Section 31.6.2, “Loading a Customized Module - Persistent Changes” for more information.
31.6.1. Loading a Customized Module - Temporary Changes
modprobein the following format as root:
modprobe <module_name> [parameter=value]
- You can enter multiple parameters and values by separating them with spaces.
- Some module parameters expect a list of comma-separated values as their argument. When entering the list of values, do not insert a space after each comma, or
modprobewill incorrectly interpret the values following spaces as additional parameters.
modprobecommand silently succeeds with an exit status of
0if it successfully loads the module, or the module is already loaded into the kernel. Thus, you must ensure that the module is not already loaded before attempting to load it with custom parameters. The
modprobecommand does not automatically reload the module, or alert you that it is already loaded.
e1000emodule, which is the network driver for Intel PRO/1000 network adapters, as an example:
Procedure 31.1. Loading a Kernel Module with Custom Parameters
- Verify whether the module is not already loaded into the kernel by running the following command:
~]# lsmod|grep e1000e e1000e 236338 0 ptp 9614 1 e1000eNote that the output of the command in this example indicates that the
e1000emodule is already loaded into the kernel. It also shows that this module has one dependency, the
- If the module is already loaded into the kernel, you must unload the module and all its dependencies before proceeding with the next step. See Section 31.4, “Unloading a Module” for instructions on how to safely unload it.
- Load the module and list all custom parameters after the module name. For example, if you wanted to load the Intel PRO/1000 network driver with the interrupt throttle rate set to 3000 interrupts per second for the first, second and third instances of the driver, and Energy Efficient Ethernet (EEE) turned on , you would run, as root:
modprobe e1000e InterruptThrottleRate=3000,3000,3000 EEE=1This example illustrates passing multiple values to a single parameter by separating them with commas and omitting any spaces between them.