Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS7 uses yum and source code to upgrade the kernel

2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

There are two ways to upgrade the kernel: first, yum upgrade the kernel

Reference: https://blog.csdn.net/kikajack/article/details/79396793

No more nonsense, direct operation, principle read other articles

1. Uname-r [root@localhost ~] # uname-r3.10.0-957.el7.x86_642, backup data 3, import epel warehouse according to the official

Reference: http://elrepo.org/tiki/tiki-index.php

[root@localhost ~] # yum install https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm-y # is a repo warehouse file [root@localhost ~] # rpm- ql elrepo-release-7.0-4.el7.elrepo.noarchchetcCharger EtcAccording to PkirepoxetcUniverSECUREMAE BOOTUE KEYMUE elrepo.org.derexetcUniverse pkipmqqetcqetcUnix pkipmqqetchand Elrepo.org/etc/yum.repos.d/etc/yum.repos.d/elrepo.repo4 、 Install the long term version

Reference: http://elrepo.org/tiki/kernel-lt

[root@localhost ~] # yum-- enablerepo=elrepo-kernel install kernel-lt5, view the existing kernel #'as the delimiter, find the line of the first column menuentry, print the second column of the changed line, and print the serial number In addition to numbers and letters, other symbols should cause [root@localhost ~] # awk-F\'$1mm = "menuentry" {print iTunes + ":" $2}'/ etc/grub2.cfg0: CentOS Linux (4.4.190-1.el7.elrepo.x86_64) 7 (Core) 1: CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core) 2: CentOS Linux (0-rescue-dd6fe5c491024a9486fa9acf832f21a6) 7 (Core) 6, Command to set grub [root@localhost ~] # grub2-set-default 07, or modify / etc/default/grub Remember to regenerate the configuration file [root@localhost ~] # sed-I's sed after modification. * $(sed's, release. * $) G'/ etc/system-release) "GRUB_DEFAULT=0GRUB_DISABLE_SUBMENU=trueGRUB_TERMINAL_OUTPUT=" console "GRUB_CMDLINE_LINUX=" rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet "GRUB_DISABLE_RECOVERY=" true "[root@localhost ~] # grub2-mkconfig-o / boot/grub2/grub.cfg 8, restart 9, clean up the old kernel (optional)

Can we not clean up the old? centos allows multiple cores to coexist.

Second, source code compiles the kernel 1, installs the necessary package [root@localhost ~] # yum install gcc ncurses-devel flex bison openssl-devel elfutils-libelf-devel-y2, decompresses the package [root@localhost ~] # tar xf linux-5.2.11.tar.xz-C / usr/src/ [root@localhost ~] # cd / usr/src/linux-5.2.11/3, Cp a configuration file slightly modified [root@localhost linux-5.2.11] # cp / boot/config-3.10.0-957.el7.x86_64 .config [root@localhost linux-5.2.11] # make menuconfig

Add a NTFS file system support:

[root@localhost linux-5.2.11] # grep-I ntfs .configCONFIG _ NTFS_FS=mCONFIG_NTFS_DEBUG=yCONFIG_NTFS_RW=y4, it took more than an hour to start compiling [root@localhost linux-5.2.11] # make-j upload [root@localhost linux-5.2.11] # du-sh .12G. [root@localhost linux-5.2.11] # find-name ntfs.ko./fs/ntfs/ntfs.ko5, Install the module [root@localhost linux-5.2.11] # make modules_ install [root @ localhost linux-5.2.11] # ls / lib/modules3.10.0-957.el7.x86_64 4.4.190-1.el7.elrepo.x86_64 5.2.11-1.0-laowang_linux_x86_64 [root@localhost linux-5.2.11] # du-sh / lib/modules/5.2.11-1.0 Laowangroomlinux86 _ 64plus 2.7g / lib/modules/5.2.11-1.0-laowang_linux_x86_64/6, Install kernel [root@localhost linux-5.2.11] # make install7, shut down Add a NTFS flash drive, boot with the new kernel, and find that you can recognize it.

If all you need is ntfs, just install ntfs-3g

[root@localhost ~] # uname-r5.2.11-1.0-laowang_linux_x86_64 [root@localhost ~] # lsblk-fNAME FSTYPE LABEL UUID MOUNTPOINTsdb └─ sdb1 ntfs Dark room A0283A0D2839E2C8 sr0 iso9660 CentOS 7 x86 houses 64 2018-11-25-21-21-31-00 sda ├─ sda2 LVM2_member h3lAZDmuri 7e2i- TiO6-x0Bc-2b41-U15R-iGMXBG │ ├─ centos-swap swap c06f8b43-1b47-4412-bae7-785f3b599368 [SWAP] │ ├─ centos-home xfs c30dee7e-0800-4737-b7b0-90db187eb3f8 / home │ └─ centos-root xfs 444b91d1-7fde-4f5d-9016-ad7b63862a5d / └─ sda1 xfs 3778e6e0-8f51-4843-8b8f-239c8b5e826b / boot [root@localhost ~] # mount / dev/sdb1 / mnt/usb [root@localhost ~] # ls / mnt/usb 8, Change the startup priority # see [root@localhost ~] # awk-F\'$1mm = "menuentry" {print iTunes + ":" $2}'/ etc/grub2.cfg0: CentOS Linux (5.2.11-1.0-laowang_linux_x86_64) 7 (Core) 1: CentOS Linux (4.4.190-1.el7.elrepo.x86_64) 7 (Core) 2: CentOS Linux (3.10.0-957.el7.x86_64) 7 ( Core) 3: CentOS Linux (0-rescue-dd6fe5c491024a9486fa9acf832f21a6) 7 (Core) # set 5.2 kernel limited startup [root@localhost] # grep-I default/ etc/default/grubGRUB_DEFAULT=0# regenerate grub configuration file [root@localhost] # grub2-mkconfig-o / boot/grub2/grub.cfg9, Manually delete compiled kernel [root@localhost ~] # rm / boot/*5.2.11*-f [root@localhost ~] # rm / boot/*5.2.11*-f [root@localhost ~] # rm-rf / lib/modules/5.2.11-1.0-laowang_linux_x86_64/ [root @ localhost ~] # rm-rf / usr/src/linux-5.2.11/ [root@localhost ~] # grub2-mkconfig-o / boot/grub2/grub.cfg

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report