Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to adjust and maintain the kernel of linux

Shulou Source: shulou.com Published: 2022-06-01 13:09:59 09月12日 Update

This article mainly explains "how to adjust and maintain the kernel of linux". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to adjust and maintain the kernel of linux"!

As the interface between user programs and system hardware, the kernel plays an important role in ensuring that Red Hat Enterprise Linux is widely used in physical and virtual hardware environments.

Identify the running kernel:

1. Red Hat Enterprise Linux version of cat / etc/redhat-release installation

2. The currently running kernel version of uname-r

3. Yum list installed kernel\ * installed kernel version

4. Processor architecture on which uname-m or arch is currently running

5.uname-a view kernel information

Sometimes, the kernel emits log messages. These messages are logged in the / var/log/messages file and marked as kernel services.

Kernel module:

Module loading and unloading

The kernel image loaded by ● at boot time is located in / boot/vmlinuz-VERSION.

● can install multiple kernels, but only one is the currently running kernel. To change the kernel, you must reboot the system.

● each kernel contains a set of dynamically loaded modules that are compatible with that kernel and remain in / lib/modules/VERSION/.

● typically loads and unloads modules as needed, without the need for user (or administrator) interaction.

● can use lsmod to list currently loaded modules.

● sometimes you may need to use modprobe MODULENAME to manually load the module.

● can use modprobe-r MODULENAME to remove modules that are no longer in use.

Kernel module information can be viewed in the / lib/modules/2.6.32-71.el6.x86_64/kernel directory

Modprobe-l lists the loaded modules

Example:

# modprobe-l | grep nf_conntrack_ftp

# modprobe nf_conntrack_ftp

# lsmod | grep nf_conntrack_ftp

# modprobe-r nf_conntrack_ftp

Kernel updates:

Download the new kernel rpm package

In theory, you should use rpm-Uvh kernel-name.rpm, but if you use U, it will crash the currently running system.

So install the kernel completely with rpm-ivh kernel-name.rpm

A new kernel will appear in / boot

In / boot/grub/grub.conf, default=0 means to use a new kernel, which needs to be rebooted to use the new kernel.

At this point, I believe you have a deeper understanding of "how to adjust and maintain the kernel of linux". 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!

Tags: Kernel module run adjust version system information content message user hardware learning practical deeper important between architecture function brand new Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno NVidia Xiaomi vpn Microsoft