Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

E.4. GRUB 故障排除

在大多数情况下,会在安装过程的最初阶段安装并配置 GRUB,除非使用指定禁用这个行为的 Kickstart 文件安装。因此安装的系统可根据选择软件包安装引导至桌面环境或命令行界面。但在某些情况下可能会出现 GRUB 配置崩溃的情况,同时系统再也无法引导。本小节论述了如何修复此类问题。

重要

GRUB cannot construct a software RAID. Therefore, the /boot directory must reside on a single, specific disk partition. The /boot directory cannot be striped across multiple disks, as in a level 0 RAID. To use a level 0 RAID on your system, place /boot on a separate partition outside the RAID.
同样,因为 /boot 目录必须位于独立特定磁盘分区中,所以如果拥有该分区的磁盘失败或者被从系统中删除,则 GRUB 将无法引导该系统。即使该磁盘在级别 1 RAID 中有镜像也是如此。下面的 Red Hat 知识库文章论述了如何从镜像中的另一个磁盘使系统可引导:https://access.redhat.com/site/articles/7094
请注意:这些问题只出现在是 RAID 的软件中,组成阵列的独立磁盘在系统中仍可视为独立磁盘。这些问题不适用于硬件 RAID,其中多个磁盘是作为单一设备出现。
修复 GRUB 配置的具体步骤要视具体问题而定。 《GNU GRUB 手册》中提供了 GRUB 在不同阶段的所有可能出错信息列表,以及其根本原因。请使用该手册作为参考。
Once you have determined the cause of the error, you can start fixing it. If you are encountering an error which only appears after you select an entry from the GRUB menu, then you can use the menu to fix the error temporarily, boot the system, and then fix the error permanently by running the grub-install command to reinstall the boot loader, or by editing the /boot/grub/grub.conf or /boot/efi/EFI/redhat/grub.conf with a plain text editor. For information about the configuration file structure, see 第 E.8 节 “GRUB 菜单配置文件”.

注意

GRUB 配置目录中有两个完全相同的文件:grub.confmenu.lst。首先会载入 grub.conf 配置文件,因此应该修改这个文件。只有在没有找到 grub.conf 文件的情况下才会载入第二个文件 menu.lst