The Linux kernel is divided into several modules, which are convenient for management and can easily add new modules to enrich the functions of the Linux system. The following is a description of the kernel module path and view kernel modules, how to manage the Linux system kernel module?
a kernel module named storage location
Linux kernel module files usually, CentOS 6.3 system kernel modules are stored centrally in /lib /modules /`uname -r In the `/[1] directory (the information obtained by uname -r is the version number of the current kernel). The following is a few examples to illustrate the basic operation of the kernel module.
Second, view the loaded kernel module
The lsmod command is used to display the current Linux kernel module status, not using any parameters will display all kernel modules currently loaded. The output three columns of information are the module name, the occupied memory size, and whether it is being used. If the third column is 0, the module can be uninstalled at any time. If it is not 0, the modprobe delete module cannot be executed.
1.[root@centos6 ~]# lsmod
2.Module Size Used by
3.bridge 79950 0
4.stp 2173 1 Bridge
5.llc 5642 2 bridge,stp
6.fuse 66891 2
7.autofs4 27212 3
8.sunrpc 263516 1
9.ipt_REJECT 2351 2
10.nf_conntrack_ipv4 9506 2
11.nf_defrag_ipv4 1483 1 nf_conntrack_ipv4
12.iptable_filter 2793 1
13 .ip_tables 17831 1 iptable_filter
14. (Partial output omitted)
<! --[if ! supportLists]-->2.9.3<! --[endif]-->Loading and Unloading Kernel Modules
Third, the modprobe command can dynamically load and unload kernel modules
1.[root@centos6 ~]# modprobe ip_vs #动态Load ip_vs module
2.[root@centos7 ~]# lsmod |
Grep ip_vs #Check if the module is loaded successfully
3.[root@centos7 ~]# modprobe -r ip_vs #dynamic uninstall ip_vs module
The modinfo command can view kernel module information:
1.[root@centos7 ~]# modinfo ip_vs
2.filename: /lib/modules/2.6.32-279.el6.x86_64/kernel/net/netfilter/ipvs/ip_vs.ko< Br>
3.license: GPL
4.srcversion: 01386EABC060B63920E181B
5.depends: ipv6,libcrc32c
6.vermagic: 2.6.32-279. El6.x86_64 SMP mod_unload modversions
Fourth, modify the kernel parameters
The kernel module loaded by the above modprobe mode is only valid at present, the module will not be loaded again after the computer restarts, if you want the system To automatically mount the kernel module at boot, you need to write the modprobe command to the /etc/rc.sysinit file:
1.[root@centos7 ~]# echo “modprobe ip_vs” >> /etc/Rc.sysinit
When the kernel module is no longer needed, you can pass the corresponding mo in the /etc/rc.sysinit file. The dprobe command is deleted, but it needs to be restarted to take effect. At this point, the kernel module can be removed immediately by the modprobe -r command:
1.[root@centos6 ~]# modprobe -r ip_vs
<! --[if ! supportLists]-->2.9.4<! --[endif]-->Modify kernel parameters
<! --[if ! supportLists]-->1.<! --[endif]--> Temporary adjustment of kernel parameters
Linux kernel parameters will be written to memory as the system starts, we can directly modify a large number of files in the /proc directory to adjust kernel parameters. And this adjustment is effective immediately.
The above is the Linux system to manage the kernel module. Using the method described in this article, you can view the kernel module, load and unload the kernel, and modify the kernel parameters. I hope I can help you. .
During the use of Linux systems, sometimes we will use some tools to backup or restore file permissi
Today Xiaobian introduces you to the Linux system shutdown and restart commands, the commands involv
We all know that Linux system startup is very fast, so what content does the Linux
The default path under Linux system is usually long, it seems very inconvenient, th
How to use make command in Linux
Ubuntu install Texmaker FAQ summary
How Linux expands the number of file openers
How to install and set up Puppet in CentOS 5.5
How to turn off recovery mode in Ubuntu 12.04 system
What can I do if I can't access mysql under Linux?
What should I do if Ubuntu fails to adjust and save the screen brightness?
Linux automatically generates a MAC address method summary
Linux uses vim for multiple file lookup and replacement methods
Linux bash shell vulnerability detection and repair method
What if CentOS 6.4 upgrades Python and yum is not available?
League of Legends LOL2015LPL summer playoffs officially started on the 11th
World of Warcraft Today Online Correction Reduces Random Archimonde
Win8 version of Foursquare application officially released
What is the compression ratio? How to adjust the compression ratio of 360 compression
What drivers are needed to successfully install the system
What can I do if the Win7 computer cannot connect to the CMCC and open the login interface?
Win7 control panel can not open how to win win7 control panel can not open solution
Windows XP latest application skills big collection [Next]
In the Windows 7 QQ concept version of the nine new features introduced