Changing Kernel Module Parameters

Kernel modules, such as hardware drivers, often have custom parameters that can be set to change the behavior of the driver or module. Several mechanisms are available to update module parameters.
  • Use sysfs to update module parameters immediately.

    You can change the values of some parameters for loaded modules and built-in drivers by writing the new value to a file under /sys/module/module_name/parameters, for example:

    echo 0 | sudo tee /sys/module/ahci/parameters/skip_host_reset

    See About the /sys Virtual File System and sysfs Directory Reference.

    Note that changes aren't persistent and don't apply automatically after reboot.

  • Use the modprobe command to change the running configuration for a module.

    To change a module's behavior, specify parameters for the module in the modprobe command:

    sudo modprobe module_name parameter=value ...

    Separate parameter and value pairs with spaces. Array values are represented by a comma-separated list, for example:

    sudo modprobe foo parm=bar arrayparm=1,2,3,4
  • Update the modprobe configuration for more permanent module configuration changes.
    Configuration files (/etc/modprobe.d/*.conf) specify module options, create module aliases, and override the usual behavior of modprobe for modules with special requirements. The /etc/modprobe.conf file that was used with earlier versions of modprobe is also valid if it exists. Entries in the /etc/modprobe.conf and /etc/modprobe.d/*.conf files use the same syntax. See Modprobe Configuration Reference for more information.