centos8内核文件和grub文件丢失或者损坏恢复
centos8模拟grub和内核文件损坏或者误删除恢复,方法与centos7系统基本一致。
1.删除/boot目录下的所有文件,将系统grub和内核严重破坏 rm -fr /boot

2.开机使用CD-ROM进入救援模式进行修复

3.选择救援模式回车,在选择救援CentOS系统回车


4.输入1,回车,在回车进入shell

5.执行chroot /mnt/sysimage/切换到系统原来的根目录,挂载光盘 mount /dev/sr0 /mnt

6.使用光盘内核rpm包重新安装内核


7.安装grub并生成grub.cfg文件
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg


8.重启系统将机器设置为硬盘引导启动,验证系统启动成功


作者:牵挂包含一种欣赏
链接:https://www.jianshu.com/p/c6029dc7ee1f
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。