Modprobe and Lsmod commands used together

Source: Internet
Author: User

The modprobe command is used to intelligently load modules into the kernel or remove modules from the kernel. The modprobe can load the specified individual modules, or load a set of dependent modules. Modprobe will determine which modules to load based on the dependencies that the depmod generates. If an error occurs during onboarding, the entire set of modules is unloaded at modprobe. Syntax Modprobe (options) (parameter) option-A or--all: Load all modules,-C or--show-conf: Displays the setup information for all modules,-D or--debug: Using the debug mode,-L or--list: Displays the available modules; R or--remove: when the module is idle, the module is automatically unloaded,-T or--type: Specifies the module type,-V or--verbose: Displays detailed information at execution time,-V or--version: Displays version information;-help: Displays Help. Argument Module Name: The name of the module to load or remove. Instance view modules configuration file: Modprobe-c Here, you can view the modules configuration file, such as what the alias alias of the module is. Will print a number of line information, such as a line like this: alias Symbol:ip_conntrack_unregister_notifier ip_conntrack lists all the modules in the kernel that are or are not mounted: modprobe-l here , we can look at the modules we need and then mount them according to our needs; the list of modules that Modprobe-l reads is located in the/lib/modules/' uname-r ' directory, where Uname-r is the kernel version, for example, one line of output is:/lib /modules/2.6.18-348.6.1.el5/kernel/net/netfilter/xt_statistic.ko Mount VFAT module: modprobe vfat Here, use the Format modprobe module name to mount a module. After mounting, you can use Lsmod to view the modules that have been mounted.
The lsmod lsmod command kernel and module management LSMOD commands are used to display state information for modules that have been loaded into the kernel. All modules loaded into the system are listed after the LSMOD command is executed. The core of the Linux operating system has a modular nature, so when compiling the core, it is important to put all the functions into the core. You can compile these functions into separate modules and load them separately when needed.

Module names cannot have suffixes, and the modules we see through Modprobe-l are all with a. ko or. o suffix. To remove a module that has already been loaded: Modprobe-r module name Here, remove the loaded module, and the Rmmod function is the same. Modprobe-l View all available modules Modprobe-l |grep ' 8021q ' [#]modprobe-l |grep ' 8021q ' kernel/net/8021q/8021q.ko8021q module can be used Modprobe 8021q load 8021q module [[email protected] ~]# lsmod |grep ' 8021q ' with lsmod to see if the load was successful 8021q 25349 0 garp 7152 1 8021qmodprobe-r 8021q unloading 8021q module

There is also a command to load the module insmod
But unlike modprobe, you must add the absolute path where the module is located.

Modprobe and Lsmod commands used together

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.