解决centos7操作系统开机提示error:file“/boot/grub/i386-pc/normal.mod“not found问题

一.问题现象

公司重要业务虚拟机突然业务访问不了,重启操作系统之后发现操作系统启动不了,直接进入救援模式,

提示:

error:file “/boot/grub/i386-pc/normal.mod“ not found

报错截图:

解决centos7操作系统开机提示error:file“/boot/grub/i386-pc/normal.mod“not found问题

二.处理思路

在救援模式下,只有很少的命令可是使用:

  1. set 设置环境变量
  2. ls 查看设备
  3. insmod 加载模块
  4. root 指定用于启动系统的分区
  5. prefix 设定grub启动路径

在救援模式下,先ls查看下设备,一般都有好多分区。

这时候要手动找到linux分区,因为我们要加载正确的模块,先找到分区就是。

通过ls命令查看/boot在哪个盘内

1.方法:ls (hd0,X)/

X为显示的号码,如果是msdos11可以直接用11代替。

该命令为查看分区下的文件,如果root单独分区了,就找到grub目录,然后ls (hd0,x)/gurb会发现还有个i386-pc目录,normal.mod文件就在该目录下。

2.设置grub的启动分区和路径

set root=(hd0,msdos1) #设置grub启动分区
set prefix=(hd0,msdos1)/boot/grub/ #设置grub启动路径

查看一下设置情况:

grub rescue> set

prefix=(hd0,msdos1)/boot/grub

root=hd0,msdos1

grub rescue> set root=(hd0,msdos2)
grub rescue> set prefix=(hd0,msdos2)/boot/grub

grub rescue>insmod normal
grub rescue>normal

输入insmod normal还是提示找不到normal.mod

解决centos7操作系统开机提示error:file“/boot/grub/i386-pc/normal.mod“not found问题

后来想了想现在用的centos7是使用grub2的。

grub2使用指令:

grub rescue> set prefix=(hd0,msdos2)/boot/grub2

3.加载基本模块

insmod /boot/grub/normal.mod #加载基本模块
insmod /boot/grub2/normal.mod #grub2使用指令
grub rescue>insmod normal

4.进入正常模式

grub rescue>normal

5.引导系统

set root=(hd0,msdos1) #设置正常启动分区
linux /boot/vmlinuz .... ro text root=/dev/sda1 #加载内核,进入控制台模式
initrd /boot/initrd .... #加载initrd.img
boot #引导

三.处理步骤

1.在救援模式下执行命令确认/boot在那个盘

  ls
  ls (hd0) 
  ls (hd0,msdos2)
  ls (hd0,msdos1)
  ls (hd0,msdos2)/
  ls (hd0,msdos2)/boot
  ls (hd0,msdos2)/root

操作界面

解决centos7操作系统开机提示error:file“/boot/grub/i386-pc/normal.mod“not found问题

  set root=(hd0,msdos2)
  set prefix=(hd0,msdos2)/boot/grub
  insmod normal
  normal

解决centos7操作系统开机提示error:file“/boot/grub/i386-pc/normal.mod“not found问题

解决centos7操作系统开机提示error:file“/boot/grub/i386-pc/normal.mod“not found问题

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持恩蓝小号。

原创文章,作者:ZANBT,如若转载,请注明出处:http://www.wangzhanshi.com/n/19359.html

(0)
ZANBT的头像ZANBT
上一篇 2025年2月24日 07:37:53
下一篇 2025年2月24日 07:37:56

相关推荐

发表回复

登录后才能评论