ubuntu22.04.4锁定内核应对海光服务器升级内核无法启动问题
文章目录
- 一、场景
- 二、机器信息
- 1.内核信息
- 2.CPU信息
- 三、锁定内核
- 总结
ubuntu锁定内核的操作记录
一、场景
项目上来了几台海光的服务器,操作系统是ubuntu2204的,就尝试这安装服务,发现安装的时候内核会自动升级,升级之后新内核无法正常引导启动。进行锁内核的操作。
二、机器信息
1.内核信息
hostnamectl :
Static hostname: XXXIcon name: computer-serverChassis: serverMachine ID: cd19257cdbca45849b97eabbb12b8de5Boot ID: 4ded862beb7045c79d82c885114d4aab
Operating System: Ubuntu 22.04.4 LTS Kernel: Linux 5.15.0-94-genericArchitecture: x86-64Hardware Vendor: SumaHardware Model: R6240H0
2.CPU信息
lscpu:
Architecture: x86_64CPU op-mode(s): 32-bit, 64-bitAddress sizes: 48 bits physical, 48 bits virtualByte Order: Little Endian
CPU(s): 64On-line CPU(s) list: 0-63
Vendor ID: HygonGenuineModel name: Hygon C86 7380 32-core ProcessorCPU family: 24Model: 2Thread(s) per core: 2Core(s) per socket: 32Socket(s): 1Stepping: 2BogoMIPS: 4400.19Flags: 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 rapl 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_nbbpext 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 vmcb_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文件
修改前
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锁定当前内核
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信息
update-grub
总结
国产化加油!!