centos7 選定默認啓動內核,及刪除無用內核

centos7 選定默認啓動內核,及刪除無用內核

1html

2linux

3centos

4app

5centos7

6spa

7rest

8code

9htm

10blog

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

#使用cat /boot/grub2/grub.cfg |grep menuentry  查看系統可用內核

[root@bigapp-slave27 ~]# cat /boot/grub2/grub.cfg |grep menuentry

if [ x"${feature_menuentry_id}" = xy ]; then

  menuentry_id_option="--id"

  menuentry_id_option=""

export menuentry_id_option

menuentry 'CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {

menuentry 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {

menuentry 'CentOS Linux (0-rescue-d57307c454c0437d91c309347178cdf5) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-d57307c454c0437d91c309347178cdf5-advanced-6f5840d0-55ac-4d3b-899b-61c0297c5347' {

 

#查看當前內核

[root@bigapp-slave27 ~]# uname -r

3.10.0-514.16.1.el7.x86_64

 

#修改開機時默認使用的內核

grub2-set-default 'CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)'

 

#查看內核修改結果

[root@bigapp-slave27 ~]# grub2-editenv list

saved_entry=CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)

 

#查看系統安裝了哪些內核包

[root@bigapp-slave27 ~]# rpm -qa |grep kernel

kernel-3.10.0-327.el7.x86_64

kernel-headers-3.10.0-514.6.1.el7.x86_64

kernel-tools-libs-3.10.0-327.el7.x86_64

kernel-3.10.0-514.16.1.el7.x86_64

kernel-tools-3.10.0-327.el7.x86_64

 

#使用yum remove 或rpm -e 刪除無用內核

yum remove kernel-3.10.0-327.el7.x86_64

相關文章
相關標籤/搜索