Given a scenario, install, configure, and monitor kernel modules Flashcards
lsmod
“The lsmod command displays the kernel modules that are loaded into memory”
insmod
“The insmod command is used to add modules to the currently running kernel”
“The insmod command has two disadvantages:
You have to know the exact location of the module.
If the module has any dependencies (a module that needs another module), it will fail to load.”
modprobe
“The modprobe command is used to add and remove modules from the currently running kernel. Note that it also attempts to load module dependencies”
“-c displays the current modprobe configuration.
- q causes modprobe to run in quiet mode.
- R displays all modules that match an alias to assist you in debugging issues.
- r removes the specified module from memory.
- v displays verbose messages; this is useful for determining how modprobe is performing a task.”
modinfo
“The modinfo command is used to provide details about a module.”
dmesg
“The dmesg command displays the in-memory copy of the kernel ring buffer. It is often used to display bootup messages for debugging purposes”
rmmod
“The rmmod command is used to remove modules from the currently running kernel”
“Modules that are currently in use will not be removed by this command by default”
“Key Options for the rm Command:
- f attempts to force removal of modules that are in use (very dangerous).
- w will wait for a module to be no longer used and then remove it.
- v displays verbose messages.”
depmod
“The depmod command builds the modules.dep file.”
“The modules.dep file contains module dependencies and is used by the modprobe command to determine which modules need to be loaded”
/usr/lib/modules/[kernelversion]
“Each kernel that is installed on the system will have a directory under the /usr/lib/ modules directory for its specific modules”
/usr/lib/modules
“The important part of these directories is that if you manually add new kernel modules to the system, you should place them in the currently used kernel directory under /usr/lib/modules prior to running the depmod command”
/etc/modprobe.conf
“On some distributions, the /etc/modprobe.conf file is used to modify how modules are loaded and unloaded. While this file was commonly used in previous releases of Linux distributions, most distributions now make use of configuration settings in the /etc/modprobe.d directory”
/etc/modprobe.d/
“most distributions now make use of configuration settings in the /etc/modprobe.d directory”