Linux系统启动过程内核文件丢失解决方法

一、问题描述

公司近期因机房断电,导致服务器重启后,引导进入不了操作系统。经过检查发现启动文件缺失,导致系统启动失败,网上搜了好多资料,解决都比较零散,现结合实际处理经验和网友的建议整理接方案。

二、操作方法

1、在Linux系统boot目录下存放着两个比较重要的文件。

CentOS6.x下:

vmlinuz-2.6.32-696.13.2.el6.x86_64

initramfs-2.6.32-696.13.2.el6.x86_64.img

CentOS 7.x下:

vmlinuz-3.10.0-862.el7.x86_64

initramfs-3.10.0-862.el7.x86_64.img

2、如果系统中内核文件vmlinuz-3.10.0-862.el7.x86_64丢失,系统还可以正常运行的状态下,可以查看该安装包,并进行重新安装。

1)使用yum  whatprovides  /boot/vmlinuz-3.10.0-862.el7.x86_64 查看该文件的安装包kernel-3.10.0-862.el7.x86_64.rpm

[root@docker-01 ~]# yum  whatprovides  /boot/vmlinuz-3.10.0-862.el7.x86_64
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
kernel-3.10.0-862.el7.x86_64 : The Linux kernel
源    :@anaconda
匹配来源:
文件名    :/boot/vmlinuz-3.10.0-862.el7.x86_64
[root@redis01 ~]# cat /etc/centos-release   //操作系统版本
CentOS Linux release 7.7.1908 (Core)
[root@redis01 ~]# uname -r     //内核版本
3.10.0-1062.4.1.el7.x86_64
[root@redis01 ~]# uname -a     //内核版本详细信息
Linux redis01 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@redis01 ~]# getconf LONG_BIT      //操作系统位数
64

  

  

原文地址:https://www.cnblogs.com/easonscx/p/12710222.html