|
|
kernel升级后无法正常启动,修改回原来的kernel版本
& f8 n8 _) f3 i! u; E$ c[root@controller1 ~]# cat /boot/grub2/grub.cfg |grep menuentry0 ^2 C+ ]2 `- w
if [ x"${feature_menuentry_id}" = xy ]; then
$ t) |9 e. n5 p9 [ menuentry_id_option="--id"
9 \, f( ]% R5 a8 j7 |# T" k8 z menuentry_id_option=""8 L) E6 f# Q; l. l6 L/ q: z
export menuentry_id_option
. J7 z* l7 `+ A) M. L4 s: Bmenuentry 'CentOS Linux (3.10.0-1160.36.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.36.2.el7.x86_64-advanced-5974cad6-c394-47ba-b4ab-04005367659d' {7 {+ j/ k( M$ g
menuentry 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.el7.x86_64-advanced-5974cad6-c394-47ba-b4ab-04005367659d' {; M! V% [% B; D* C6 F
menuentry 'CentOS Linux (0-rescue-3128f8b8b4814d42b2e9ba95ea070d87) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-3128f8b8b4814d42b2e9ba95ea070d87-advanced-5974cad6-c394-47ba-b4ab-04005367659d' % S+ Y8 w* M+ Q
$ _; q+ T: C: \% {) D$ [
% N* w3 x" H* U1 E, D( u[root@controller1 ~]# grub2-set-default 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)', u3 Z8 h9 d; B
+ P" i; K+ C4 F/ M6 k2 h; ]( T[root@compute3 ~]# grub2-editenv list 1 t8 A. q* I$ c
saved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
1 P8 i, d$ u5 t: I8 v- z3 |% S$ \1 A, K, L& w8 w- s# k+ u ?9 t1 J8 a T* j
或者修改启动顺序:4 F4 r$ }* x3 q) a
- H- X* P1 u3 v5 a. z; d9 z" w8 ~
# vi /boot/grub2/grub.cfg 2 Q9 m3 R: x: z
### BEGIN /etc/grub.d/10_linux ###
, }* E! B. @. Q' [( j4 E8 Nmenuentry 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-1160.el7.x86_64-advanced-a829191f-3509-4590-b76a-230fc09056f7' {
% _/ k) @% K7 o- Z load_video
( Y# Q4 c+ g8 o! F+ v set gfxpayload=keep
2 ^7 |2 S! G! q% i8 u+ B' n insmod gzio
7 X0 E1 _+ K& b+ b; u1 v9 l insmod part_msdos6 q( o2 i3 S# Z
insmod xfs& |- ^) ] _- Q; x
set root='hd0,msdos1'
6 a# ~9 X4 x' N1 J8 o ] if [ x$feature_platform_search_hint = xy ]; then* P7 W, P' C1 ~* D1 m, Q) v w1 V
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' b6fd6b2b-adcf-4eea-8c75-e2ce34a4909e
, ]$ c/ a1 V9 j% n* g$ S else7 l8 d1 y3 ?. y" M5 `
search --no-floppy --fs-uuid --set=root b6fd6b2b-adcf-4eea-8c75-e2ce34a4909e3 y# R* e6 I4 `5 P& ?- N
fi' l% F6 T4 x* b% r
linux16 /vmlinuz-3.10.0-1160.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
$ e# C: J, Y* X0 \( w* c6 ~' c initrd16 /initramfs-3.10.0-1160.el7.x86_64.img7 S# r9 ^ J" K' V6 G
}
! V0 V& s6 V. P4 |% ]% r5 [7 X: y& t# N" O9 B; E: }
重启系统:+ {# b$ S1 b9 g& P3 A: ]
查看:* L5 r4 ^$ B6 ^
$ [6 n" N3 [4 c4 g[root@compute3 ~]# grub2-editenv list
) Q7 l1 w/ Z- o4 S2 B0 s! R0 @saved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
: }( I3 m! F9 _" }. M! t; U8 c
' o1 w; |5 A: k; a6 ? H% R/ G& B! R
grub2-editenv list ; N4 }. f) ? ^5 ^
重启系统, P4 A% D; k& P/ u3 z9 G. ^
reboot, ]1 l/ T/ f) f3 T
/ q& V, a8 v, I0 Y' D, c! y
|
|