Locked History Actions

Diff for "CentOS7-kernel"

Differences between revisions 4 and 5
Revision 4 as of 2019-11-01 01:55:44
Size: 2647
Comment:
Revision 5 as of 2019-11-01 01:57:48
Size: 2646
Comment:
Deletions are marked like this. Additions are marked like this.
Line 69: Line 69:
[root@host]#  grub2-set-default 2 [root@host]# grub2-set-default 2

CentOS7 (SL7) OS デフォルトのカーネルを変更・指定する

1. 現在のデフォルトを調べる (CentOS7 SL7 共通)

[root@host]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1062.4.1.el7.x86_64) 7 (Core)
[root@host]# 

2.インストールされているカーネルのリストを表示する

CentOS7 の場合

[root@host]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (3.10.0-1062.4.1.el7.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-1062.1.2.el7.x86_64) 7 (Core)
2 : CentOS Linux (3.10.0-1062.1.1.el7.x86_64) 7 (Core)
3 : CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)
4 : CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)
5 : CentOS Linux (0-rescue-0147aeec4ca94412b78f0954901a0d89) 7 (Core)
6 : CentOS Linux release 7.0.1406 (Core)  (on /dev/sdb3)
[root@host]# 

SL7 の場合

[root@host]# awk -F\' '$1=="menuentry " {print i++ " : " $2}'  /etc/grub2-efi.cfg 
0 : Scientific Linux (3.10.0-1062.4.1.el7.x86_64) 7.7 (Nitrogen)
1 : Scientific Linux (3.10.0-1062.1.2.el7.x86_64) 7.7 (Nitrogen)
2 : Scientific Linux (3.10.0-957.27.2.el7.x86_64) 7.6 (Nitrogen)
3 : Scientific Linux (0-rescue-98616bc5eae144c184174f8b6905d94a) 7.2 (Nitrogen)
[root@host]# 

3. 利用したいカーネルをデフォルトに設定する

CentOS7 の場合 例えば 3 : CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core) に変更する場合は

[root@host]# grub2-set-default 3
[root@host]# grub2-editenv list
saved_entry=3

NOTE: カーネルのリストが0(ゼロ)から始まっている点に気をつけて下さい。

SL7 の場合 例えば 2 : Scientific Linux (3.10.0-957.27.2.el7.x86_64) 7.6 (Nitrogen) に変更する場合は

[root@host]# grub2-set-default 2
[root@host]# grub2-editenv list
saved_entry=2

NOTE: カーネルのリストが0(ゼロ)から始まっている点に気をつけて下さい。