ubuntu22.04.4锁定内核应对海光服务器升级内核无法启动问题

文章目录


ubuntu锁定内核的操作记录


一、场景

项目上来了几台海光的服务器,操作系统是ubuntu2204的,就尝试这安装服务,发现安装的时候内核会自动升级,升级之后新内核无法正常引导启动。进行锁内核的操作。

二、机器信息

1.内核信息

hostnamectl :

shell 复制代码
 Static hostname: XXX
       Icon name: computer-server
         Chassis: server
      Machine ID: cd19257cdbca45849b97eabbb12b8de5
         Boot ID: 4ded862beb7045c79d82c885114d4aab
Operating System: Ubuntu 22.04.4 LTS              
          Kernel: Linux 5.15.0-94-generic
    Architecture: x86-64
 Hardware Vendor: Suma
  Hardware Model: R6240H0

2.CPU信息

lscpu:

shell 复制代码
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  64
  On-line CPU(s) list:   0-63
Vendor ID:               HygonGenuine
  Model name:            Hygon C86 7380 32-core Processor
    CPU family:          24
    Model:               2
    Thread(s) per core:  2
    Core(s) per socket:  32
    Socket(s):           1
    Stepping:            2
    BogoMIPS:            4400.19
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid amd_dcm aperfmperf r
                         apl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw skinit wdt tce topoext perfctr_core perfctr_nb
                          bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmc
                         b_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sme sev sev_es
Virtualization features: 
  Virtualization:        AMD-V

三、锁定内核

编辑/etc/default/grub文件

修改前

shell 复制代码
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

修改GRUB_DEFAULT锁定当前内核

shell 复制代码
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.15.0-94-generic"
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

更新grub信息

shell 复制代码
update-grub

总结

国产化加油!!

相关推荐
IT瑞先生7 分钟前
运维专题3——业务进程排查方法论
运维·网络
枳实-叶10 分钟前
【Linux驱动开发】第10天:设备树零基础入门——DTS/DTB/DTC全解+编译流程
linux·运维·驱动开发
枳实-叶13 分钟前
【Linux驱动开发】第11天:设备树(Device Tree)超详细全解:从诞生背景到工作原理
linux·运维·驱动开发
Bert.Cai27 分钟前
Linux shift命令详解
linux·运维·服务器
叶~小兮30 分钟前
Zabbix 7.0 深度原理与生产进阶运维学习笔记
运维·学习·zabbix
cui_ruicheng30 分钟前
Linux网络编程(六):UDP聊天室与线程池
linux·服务器·网络·udp
小明同学0130 分钟前
C++后端项目:统一大模型接入 SDK(五)
服务器·c++·后端·计算机网络·语言模型
运维自动化&云计算32 分钟前
修复chrome把mp4视频识别为音频、firefox不能加载mp4问题
服务器·前端·iis·mp4播放
XMAIPC_Robot36 分钟前
深度无人机自动驾驶仪,中小型无人机硬件在环仿真飞行
运维·arm开发·人工智能·fpga开发·无人机·边缘计算
文青小兵36 分钟前
云计算Linux——数据库MySQL读写分离、数据库备份、恢复(十八)
linux·运维·服务器·数据库·mysql·云计算