找回密码
 注册
查看: 1746|回复: 0

kernel升级后无法正常启动,修改回原来的kernel版本

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-8-11 12:04:03 | 显示全部楼层 |阅读模式
kernel升级后无法正常启动,修改回原来的kernel版本1 B' _3 C0 {4 t  p
[root@controller1 ~]# cat /boot/grub2/grub.cfg |grep menuentry
5 `% f: r% U8 w/ Zif [ x"${feature_menuentry_id}" = xy ]; then
( A) Z% S: [( f  w) O  menuentry_id_option="--id"( K. G6 t" M4 t8 B+ U2 `/ V6 G  |+ d' D
  menuentry_id_option=""4 X6 `5 U  Y) ~: R  m7 ?
export menuentry_id_option& Y1 a$ d. z2 Q* }
menuentry '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' {; A! ?" X) h3 b1 e4 L- R
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' {
( t6 Q7 d( W4 g7 _* |2 i) `) U% Cmenuentry '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'
9 c' @2 m# f6 }2 G2 [2 x3 a* H5 D  [

# f: ]& A- o4 h[root@controller1 ~]# grub2-set-default 'CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)'
& s. O2 E: Q0 y; g% ?
* R8 s2 q- O2 l9 ^[root@compute3 ~]# grub2-editenv list
6 ~& u4 p9 ?8 l2 U! \5 F; j2 ?0 Ysaved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)
' t8 v: Z: ~6 L- S: p4 F
) f6 F% k* [* H9 V或者修改启动顺序:) o( y" ]( c% k' O0 n: X0 t
* V$ l( V/ p1 u4 r* @3 P& A4 ^2 J
# vi /boot/grub2/grub.cfg
( s  f, U9 M) S2 h! \4 v7 Y) J6 i### BEGIN /etc/grub.d/10_linux ###3 t& \, ~0 J* N- |* B
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-a829191f-3509-4590-b76a-230fc09056f7' {
# v0 \; o5 Z+ Y2 j9 @        load_video9 X. g: f4 U$ U! \
        set gfxpayload=keep' ?0 H3 P- a# {9 Q# I5 s$ ~: P
        insmod gzio" t+ o7 J4 ^) \
        insmod part_msdos
8 W$ q, I8 [+ Q& ~* R1 f; M2 C6 C        insmod xfs
; t4 b' c$ ~3 `* O: O% u8 v4 T! ^        set root='hd0,msdos1'  V* u2 c( j) ~/ r
        if [ x$feature_platform_search_hint = xy ]; then" `" t3 w; `5 n- J& l
          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: ^) ~0 W, Q; s4 F( Y
        else/ E# g2 \% L" B" G
          search --no-floppy --fs-uuid --set=root b6fd6b2b-adcf-4eea-8c75-e2ce34a4909e* W% }. x3 J+ e$ w9 \
        fi% I' R$ j9 G4 h3 Y" C: ?! p- O2 \4 I
        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
) R( J% `: s+ _5 E! _8 E        initrd16 /initramfs-3.10.0-1160.el7.x86_64.img9 F$ B* `+ J) J7 [: N- v
}4 @7 n8 o  ]; {; m8 K( ?+ E

+ l* Y- ^; P$ {; Q6 d5 R重启系统:
, s( O$ A, l# ?$ X, B+ X查看:
3 q# X( d4 G8 d" G  O8 q' P$ Z
8 s. _/ U  g! C- F1 w( ~[root@compute3 ~]# grub2-editenv list
- I: P. u, a0 V7 a* ?saved_entry=CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core)0 V5 Q# L; g, Z) R0 }% {

1 ^3 |4 P( s* K& I1 J4 z4 ^7 Q; ^- B6 L$ e: _/ |6 m# F, b: \: ]" ~
grub2-editenv list 5 X3 t$ d7 b( l) I' X/ _
重启系统% H7 P# v3 j: }8 {( Z
reboot% |6 j; c  S% u- ]% L+ Z* {
7 u( b2 V+ v2 p6 n: r
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:20 , Processed in 0.015800 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表