Summary of some kernel management commands in Linux systems

Source: Internet
Author: User

1, lsmod column to mount the kernel module;

Lsmod is the name and size of the module loaded in the current system, and we can also view the/proc/modules, we can know the system has loaded the module;

The code is as follows:

[Root@localhost beinan]# Lsmod

[/code]

2, Modinfo view module information;

Modinfo can view the information of the module and determine the use of the module by viewing the module information;

The code is as follows:

[root@localhost beinan]# moinfo module name

Example:

The code is as follows:

[Root@localhost beinan]# Modinfo Ne2k-pci

FileName:/lib/modules/2.6.11-1.1369_fc4/kernel/drivers/net/ne2k-pci.ko

Author:donald Becker/paul Gortmaker

Description:pci NE2000 Clone Driver

License:gpl

Parmtype:debug:int

Parmtype:options:array of INT

Parmtype:full_duplex:array of INT

Parm:debug:debug level (1-2)

Parm:options:Bit 5:full Duplex

Parm:full_duplex:full Duplex Setting (s) (1)

VERMAGIC:2.6.11-1.1369_FC4 686 Regparm 4KSTACKS gcc-4.0

depends:8390

alias:pci:v000010ecd00008029sv*sd*bc*sc*i*

alias:pci:v00001050d00000940sv*sd*bc*sc*i*

alias:pci:v000011f6d00001401sv*sd*bc*sc*i*

alias:pci:v00008e2ed00003000sv*sd*bc*sc*i*

alias:pci:v00004a14d00005000sv*sd*bc*sc*i*

alias:pci:v00001106d00000926sv*sd*bc*sc*i*

alias:pci:v000010bdd00000e34sv*sd*bc*sc*i*

alias:pci:v00001050d00005a5asv*sd*bc*sc*i*

alias:pci:v000012c3d00000058sv*sd*bc*sc*i*

alias:pci:v000012c3d00005598sv*sd*bc*sc*i*

alias:pci:v00008c4ad00001980sv*sd*bc*sc*i*

Srcversion:6ace95f441cd26df9dc31c2

The above example is the information we see NE2K-PCI This module, and by looking at it, we know that the Ne2k-pci module is the driver of the 8029 NIC (PCI NE2000 clone driver); The module is located in/lib/modules/2.6.11-1.1369_ fc4/kernel/drivers/net/Ne2k-pci.ko We are now commonly used in the network card also has 8139, 8139 network card used by the driver is 8139too; check it out?

The code is as follows:

[Root@localhost beinan]# Modinfo 8139too

Let's check the module information of VFAT and NTFS again;

The code is as follows:

[Root@localhost beinan]# Modinfo VFAT

[Root@localhost beinan]# modinfo NTFS

Try it yourself; Note: The module name is not a suffix, we see through the Modprobe-l module, are with the. ko or. o suffix;

3, modprobe load new modules and new modules rely on the module

Modprobe Our common function is to mount the module, while a kernel module is mounted, the module on which the module is dependent is also mounted simultaneously; Of course, modprobe also lists all the modules in the kernel, as well as the function of removing modules; Let me give you an example of our commonly used functions and parameters;

The code is as follows:

modprobe [-v] [-v] [-c Config-file] [-n] [-i] [-Q] [-o ] [parameters ...]

Modprobe-r [-n] [-i] [-v] ...

Modprobe-l-T [-a ...]

Above is the use of modprobe, specifically more detailed help, we can view the man modprobe;

The code is as follows:

[Root@localhost beinan]# Modprobe-c

Modprobe-c can view the modules configuration file, such as what the alias of the module is;

The code is as follows:

[Root@localhost beinan]# Modprobe-l

Modprobe-l is a list of all the modules in the kernel, including those that are mounted and not mounted; Through modprobe-l, we can look up the modules we need and mount them according to our needs; in fact, the list of modules Modprobe-l read is located in/lib/modules/' Uname-r ' directory, where Uname-r is the kernel version;

The code is as follows:

[Root@localhost beinan]# Uname-r

2.6.11-1.1369_fc4

[Root@localhost beinan]# ls/lib/modules/2.6.11-1.1369_fc4/

Through the above command, try it yourself?

The code is as follows:

[root@localhost beinan]# modprobe module name

Note: mount a module;

Example:

The code is as follows:

[Root@localhost beinan]# modprobe Ne2k-pci

Note: Mount NE2K-PCI module;

The code is as follows:

[Root@localhost beinan]# modprobe VFAT

Note: Mount VFAT module

The code is as follows:

[Root@localhost beinan]# modprobe NTFS

Note: Mount NTFS modules

The code is as follows:

[Root@localhost beinan]# Lsmod

Note: List the mounted modules and we will see NE2K-PCI, VFAT, NTFS modules;

Note: The module name is not a suffix, we see through the Modprobe-l module, are with the. ko or. o suffix;

The code is as follows:

[root@localhost beinan]# modprobe-r module name

Note: Remove the loaded module, and the Rmmod function is the same;

Note: The module name is not a suffix, we see through the Modprobe-l module, are with the. ko or. o suffix;

The code is as follows:

[root@localhost beinan]# modprobe-r module name

Example:

The code is as follows:

[Root@localhost beinan]# modprobe-r Ne2k-pci

That's all you have to say.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.