I tried to upgrade the system to 2.6.31 before, but the result failed. I didn't try again because I was too busy. Recently, I was a little blank and thought about it again. Go to www.kernel.org and check that all the latest kernel versions are 2.6.33, So we plan to upgrade 2.6.33 directly. I. Environment Use Vmware installation installed RedHat5.3, the following are the use of root users to operate # uname-r2.6.18-53.el5 2, upgrade process 1)
I tried to upgrade the system to 2.6.31 before, but the result failed. I didn't try again because I was too busy. Recently, I was a little blank and thought about it again. Go to www.kernel.org and check that all the latest kernel versions are 2.6.33, So we plan to upgrade 2.6.33 directly.
I. Environment
The RedHat5.3 installed on Vmware is used. The following operations are performed by the root user.
# Uname-r
2.6.18-53. el5
Ii. Upgrade process
1) download the kernel
Before upgrading to www.kernel.org to see if there is any latest kernel, so far the latest is 2.6.33, is: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.tar.bz2
2) Copy linux-2.6.33.tar.bz2 to the/usr/local/src directory, decompress the following command to obtain the folder linux-2.6.33
Tar xjvf linux-2.6.33.tar.bz2
3) make distclean
This step can be omitted if it is the first compilation.
4) copy the original config file to the linux-2.6.33 directory
# Cd/usr/local/src/linux-2.6.33
# Cp/boot/config-2.6.18-53.el5. config
5) make menuconfig
Select Load an Alternate Configuration File and import the. config File to simplify or add functions.
Note: There are two Kernel configuration methods: one is directly placed into the kernel *; the other is compiled into the module M; the two methods have their own advantages; directly compiled into the kernel, for example, when a device starts, the module does not need to be loaded; when compiled into a module, the module supported by the kernel of the device needs to be loaded; however, it is not feasible to directly compile everything into the kernel. The kernel size will increase and the system load will be too heavy. When compiling the kernel, it is best to compile the extremely important data into the kernel. If you do not understand anything else, it is best to use the default [3].
After modification, select Save an Alternate Configuration File and exit the Configuration.
6) modify the. config file
Search CONFIG_SYSFS_DEPRECATED_V2 in the. config file and you will find the line # CONFIG_SYSFS_DEPRECATED_V2 is not set. Change this line to CONFIG_SYSFS_DEPRECATED_V2 = y.
If this row is not modified, the following error is reported after the upgrade is restarted, resulting in startup failure.
Volume group "VolGroup00" not found
Unalbe to access resume device (/dev/VolGroup00/LogVol00)
Mount: cocould not find filesystem '/dev/root'
Setuproot: moving/dev failed: No such file or directory
Setuproot: error mounting/proc: No such file or directory
Setuproot: error mounting/sys: No such file or directory
Switchroot: mount failed: No such file or directory
Kernel panic-not syncing: Attempted to kill init!
7) Compile the kernel
# Make all
It takes about half an hour to an hour.
8) # make modules_install
9) # make install
At this time, three warnings will appear [2].
WARNING: No module dm-mem-cache found for kernel 2.6.33, continuing anyway
WARNING: No module dm-message found for kernel 2.6.33, continuing anyway
WARNING: No module dm-raid45 found for kernel 2.6.33, continuing anyway
After testing, these three warnings do not affect kernel upgrades. See [2] for relevant instructions.
10) modify the initrd File
If the error insmod: error inserting '/lib/dm-region-hash.ko':-1 File exits is reported after the upgrade and restart, this is because the init in initrd contains a duplicate of the dm-region-hash.ko module, therefore, you need to modify the generated initrd file (not all machines will encounter this error). The modification method is as follows [1]. For details, refer to reference 1:
A) decompress initrd.
# Cp/boot/initrd-2.6.33.img/tmp
# Cd/tmp/
# Ls
Initrd-2.6.33.img
# Mkdir newinitrd
# Cd newinitrd/
# Zcat ../initrd-2.6.33.img | cpio-I
# Ls
Bin dev etc init lib proc sbin sys sysroot
B) EDIT init and delete the duplicate two rows.
Echo "Loading dm-region-hash.ko module"
Insmod/lib/dm-region-hash.ko
Echo "Loading dm-region-hash.ko module"
Insmod/lib/dm-region-hash.ko
C) repackage initrd
# Find. | cpio-c-o> ../initrd
# Cd ..
# Gzip-9 <initrd> initrd-2.6.33.img
D) Copy initrd to the/boot directory again.
# Cpinitrd-2.6.33.img/boot
11) Restart
Started successfully.
# Uname-r
2.6.33