🌐 🇵🇱 Polski · 🇬🇧 EN
The heart of a RedHat system is the kernel. The kernel is responsible for managing the devices within the machine and displaying the results of these devices' operations on the screen. It is also a virtual file system created in the /proc directory, where information and parameters regarding the kernel are kept. In this part, we will learn basic information related to the system kernel, methods of updating it, and ways to optimize its performance. Although the discussed topics focus mainly on tasks that need to be performed for the exam and are written with that in mind—meaning the emphasis is placed on the RedHat system—the subject of the system kernel also applies to other Linux distributions.
KERNEL BASICS
Linux is, in fact, the kernel itself. RedHat and other distributions, together with the software and configuration files used in the system kernel, constitute the entire operating system. Because the kernel allows all devices in the system to operate under user control, a good understanding of its functioning is very important. The kernel is used to load new drivers, support the operation of new hardware, and offers the ability to customize it to individual needs. The Linux kernel has a modular structure because we can load and unload individual modules during system startup. The following commands will be useful for working with the system kernel:
- uname - Displays information about the system kernel
- lsmod - Current list of loaded modules
- modinfo - Information about a specific kernel module
- sysctl - Enables configuration of kernel parameters
Let's check which kernel version is currently running:
# uname -a
Linux RHEL01 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64
x86_64 GNU/Linux
Important information is the kernel version number (2.6.32-71.el6.x86_64). The first value is the version number, the second value is the release number. The next value is information about the kernel's target for RHEL06, followed by information about the architecture it was prepared for.
Similar information can be obtained by checking the installed package:
# rpm -qa | grep kernel
kernel-2.6.32-71.el6.x86_64
You can also use the command:
# rpm –q kernel
When working with system kernels, you should also familiarize yourself with 4 locations in the system:
- /boot - The place where the kernel and system startup files are kept
- /proc - Current hardware configuration and their status
- /usr/src - Kernel source code
- /lib/modules - Kernel modules
In earlier chapters, we talked about system initialization - the kernel is also an element of the environment startup. Since the kernel has a modular structure, it is important to understand which modules are used and how to check this. For this purpose, we will use the "lsmod" command.
# lsmod
Module Size Used by
autofs4 29253 3
hidp 23105 2
rfcomm 42457 0
l2cap 29505 10 hidp,rfcomm
ext4 353979 2
[output truncated]
If we want to learn more about a specific module, the "modinfo" command comes in handy.
# modinfo ext4
filename:/lib/modules/2.6.32-71.el6.x86_64/kernel/fs/ext4/ext4.ko
license: GPL
description: Fourth Extended Filesystem
author: Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger,
Theodore Ts’o and others
srcversion: 8689F457D14068A36A86631
depends: mbcache,jbd2
vermagic: 2.6.32-71.el6.x86_64 SMP mod_unload modversions
Although there is no need to know everything about the kernel for the Red Hat exam, it is worth knowing how to find information about which kernel and what version is running on a given system.
Comments