In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "what kernel management commands are there in the Linux system". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn what kernel management commands are available in the Linux system.
1. Kernel module mounted by lsmod column
Lsmod lists the names and sizes of modules that have been loaded in the system. In addition, we can also check / proc/modules, and we can also know which modules have been loaded in the system.
The code is as follows:
[root@localhost beinan] # lsmod
[/ code]
2. Modinfo to view module information
Modinfo can view the information of the module and determine the purpose of the module by viewing the information of the module
The code is as follows:
[root@localhost beinan] # moinfo module name
For 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 686REGPARM 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 that we look at the information of the ne2k-pci module. By looking at it, we know that the ne2k-pci module is the driver of the 8029 network card (PCI NE2000 clone driver); the module is located in / lib/modules/2.6.11-1.1369_FC4/kernel/drivers/net/ ne2k-pci.ko We now commonly used network card also has 8139, the driver of the 8139 network card is 8139too; check?
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: module names cannot be suffixed. Modules we see through modprobe-l are all suffixed with .ko or .o.
3. Modprobe mounts the new module and the modules that the new module depends on
Modprobe our common function is to mount a module. When a kernel module is mounted, the module that this module depends on is also mounted. Of course, modprobe also lists all kernel modules and removes modules. Let's give an example to talk about our common 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...]
The above is the use of modprobe. For more detailed help, we can check out man modprobe.
The code is as follows:
[root@localhost beinan] # modprobe-c
Modprobe-c can view the configuration file of modules, such as what is the alias of the module
The code is as follows:
[root@localhost beinan] # modprobe-l
Modprobe-l lists all the modules in the kernel, both mounted and unmounted; through modprobe-l, we can look up the modules we need and mount them according to our needs; in fact, the list of modules read by modprobe-l is located in the / 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 orders, try it yourself?
The code is as follows:
[root@localhost beinan] # modprobe module name
Note: Mount a module
For example:
The code is as follows:
[root@localhost beinan] # modprobe ne2k-pci
Note: Mount the ne2k-pci module
The code is as follows:
[root@localhost beinan] # modprobe vfat
Note: Mount the vfat module
The code is as follows:
[root@localhost beinan] # modprobe ntfs
Note: Mount the ntfs module
The code is as follows:
[root@localhost beinan] # lsmod
Note: if you list the mounted modules, we will see the modules of ne2k-pci, vfat, and ntfs
Note: module names cannot be suffixed. Modules we see through modprobe-l are all suffixed with .ko or .o.
The code is as follows:
[root@localhost beinan] # modprobe-r module name
Note: remove loaded modules with the same function as rmmod
Note: module names cannot be suffixed. Modules we see through modprobe-l are all suffixed with .ko or .o.
The code is as follows:
[root@localhost beinan] # modprobe-r module name
For example:
The code is as follows:
[root@localhost beinan] # modprobe-r ne2k-pci
That's all you have to say.
At this point, I believe you have a deeper understanding of "what kernel management commands are in the Linux system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.