In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to easily upgrade the CentOS kernel, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
To test some software, you need more than 2.6.30 kernel. Install CentOS 5.5.The kernel is 2.6.18-194.el5. This upgrade is relatively smooth, the specific process is as follows:
[root@localhost] # uname-r2.6.18-194.el5
1. Download the linux-2.6.30 kernel package to the / usr/src directory
Cd / usr/srcwget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.30.tar.gztar-xzvf linux-2.6.30.tar.bz2-C / usr/srccd linux-2.6.30make mrproper clears the environment variable, that is, clears the configuration file make menuconfig and selects the kernel module that needs to be compiled in menu mode:
Networking support- > networking options- > network packet filtering framework (netfilter)
(1) core netfilter configuration
A box in the "Netfilter connection tracking support"-m state related module is dependent on it, do not select it.
B compile netbios name service protocal support (new) into a module, otherwise there will be an error when starting after upgrading iptables
C ticks "Netfilter Xtables support (required for ip_tables)"
(2) IP: Netfilter Configuration
A compiles "IPv4 connection tracking support (require for NAT)" into a module.
B ticks IP tables support (required for filtering/masq/NAT).
C compiles "MASQUERADE target support" and "REDIRECT target support" under "Full NAT" into modules
(3)。 Other modules can be selected according to their own needs, if you do not understand, you can refer to the kernel configuration manual.
Make clean ensures that everything is kept in a state of *.
Make bzImage generates kernel files
Make modules compiler module
Make modules_install installation module
Make install installation
Mkinitrd / boot/initrd_2.6.30.img 2.6.30 generates an image file based on kernel version and specified parameters
Cp arch/x86/boot/bzImage / boot/vmlinuz-2.6.30
Cp / usr/src/linux-2.6.30/System.map / boot/System.map-2.6.30
two。 Add the following 2.6.30 information to / etc/grub.conf and change default=1 to default=0
[root@localhost] # cat / etc/grub.conf# grub.conf generated by anaconda## Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a / boot partition. This means that# all kernel and initrd paths are relative to / boot/ Eg.# root (hd0,0) # kernel / vmlinuz-version ro root=/dev/VolGroup00/LogVol00# initrd / initrd-version.img#boot=/dev/sdadefault=0timeout=5splashimage= (hd0,0) / grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.18-194.el5) root (hd0,0) kernel / vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quietinitrd / initrd-2.6.18-194.el5.imgtitle CentOS (2.6.30) root (hd0,0) kernel / vmlinuz-2.6.30 Ro root=/dev/VolGroup00/LogVol00 rhgb quietinitrd / initrd-2.6.30.img
3. If there is no operation in this step, the restart will report an error "insmod: error inserting'/ lib/dm-region-hash.ko':-1 File exits". According to the information found on the Internet, the 2.6.x self-compiled kernel will have this small bug. I have tested that it can be restarted without modification. Although there is an error, it can still enter the system.
[root@localhost] cp / boot/initrd-2.6.30.img / TMP [root @ localhost] cd / tmp/ [root@localhost tmp] mkdir newinitrd [root@localhost tmp] cd newinitrd/ [root@localhost newinitrd] zcat.. / initrd-2.6.30.img | cpio-I [root@localhost newinitrd] vi init delete the following two duplicate lines: echo "Loading dm-region-hash.ko module" insmod / lib/dm-region-hash.ko [root@localhost newinitrd] # find. | cpio- C-o >.. / initrd14765 blocks [root@localhost newinitrd] # cd. [root@localhost tmp] # gzip-9
< initrd >Initrd-2.6.30.img [root@localhost tmp] # lsgconfd-root initrd initrd-2.6.30.img mapping-root newinitrd scim-panel-socket:0-root [root@localhost tmp] # mv / boot/initrd-2.6.30.img / home/ [root@localhost tmp] # cp initrd-2.6.30.img / boot/ [root@localhost tmp] # reboot
4. After the reboot is successful, take a look at the kernel, it is 2.6.30 OK.
[root@localhost] # uname-r2.6.30 after reading the above, do you know how to easily upgrade the CentOS kernel? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.