您好,登錄后才能下訂單哦!
參考:https://blog.csdn.net/kikajack/article/details/79396793
不多廢話(huà)了,直接操作,原理看別的文章
[root@localhost ~]# uname -r
3.10.0-957.el7.x86_64
參考: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
#就是一個(gè)repo倉(cāng)庫(kù)文件
[root@localhost ~]# rpm -ql elrepo-release-7.0-4.el7.elrepo.noarch
/etc/pki/elrepo
/etc/pki/elrepo/SECURE-BOOT-KEY-elrepo.org.der
/etc/pki/rpm-gpg
/etc/pki/rpm-gpg/RPM-GPG-KEY-elrepo.org
/etc/yum.repos.d
/etc/yum.repos.d/elrepo.repo
參考:http://elrepo.org/tiki/kernel-lt
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt
# '作為分隔符,查找第一列為menuentry的行,打印改行的第二列,i++打印序號(hào),除了數(shù)字和字母其他符號(hào)要引起來(lái)
[root@localhost ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : 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)
[root@localhost ~]# grub2-set-default 0
[root@localhost ~]# sed -i 's/GRUB_DEFAULT=saved/GRUB_DEFAULT=0/' /etc/default/grub
[root@localhost ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_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
能不清理舊別清理吧,centos允許多內(nèi)核共存
[root@localhost ~]# yum install gcc ncurses-devel flex bison openssl-devel elfutils-libelf-devel -y
[root@localhost ~]# tar xf linux-5.2.11.tar.xz -C /usr/src/
[root@localhost ~]# cd /usr/src/linux-5.2.11/
[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
加一個(gè)NTFS文件系統(tǒng)支持:
[root@localhost linux-5.2.11]# grep -i ntfs .config
CONFIG_NTFS_FS=m
CONFIG_NTFS_DEBUG=y
CONFIG_NTFS_RW=y
[root@localhost linux-5.2.11]# make -j 4
#經(jīng)過(guò)了一個(gè)多小時(shí)
[root@localhost linux-5.2.11]# du -sh .
12G .
[root@localhost linux-5.2.11]# find -name ntfs.ko
./fs/ntfs/ntfs.ko
[root@localhost linux-5.2.11]# make modules_install
[root@localhost linux-5.2.11]# ls /lib/modules
3.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-laowang_linux_x86_64/
2.7G /lib/modules/5.2.11-1.0-laowang_linux_x86_64/
[root@localhost linux-5.2.11]# make install
如果只是需要ntfs,只需安裝ntfs-3g
[root@localhost ~]# uname -r
5.2.11-1.0-laowang_linux_x86_64
[root@localhost ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb
└─sdb1 ntfs 小黑屋 A0283A0D2839E2C8
sr0 iso9660 CentOS 7 x86_64 2018-11-25-21-21-31-00
sda
├─sda2 LVM2_member h3lAZD-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
#查看下
[root@localhost ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : 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)
#設(shè)置5.2內(nèi)核有限啟動(dòng)
[root@localhost ~]# grep -i default /etc/default/grub
GRUB_DEFAULT=0
#重新生成grub配置文件
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
[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
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。