Show Table of Contents
36.3. 使用救援模式修复或绕过驱动程序问题
发生故障或缺少驱动程序会让系统无法正常引导。恢复模式提供了系统无法引导时,可以添加、删除或替代驱动程序的环境。只要有可能,我们都推荐使用 RPM 软件包管理器删除发生故障的驱动、添加已更新或丢失的驱动。如果由于某种原因无法删除驱动程序,则可以将驱动程序放入黑名单,使其不会在引导时载入。
请注意,当使用驱动盘安装驱动程序时,驱动盘会更新系统上的所有 initramfs 映像,以便使用这个驱动程序。如果由于驱动程序的问题让系统无法引导,就无法使用 initramfs 映像引导系统。
36.3.1. 使用 RPM 添加、删除或者替换驱动程序
在救援模式中,即使还没有引导系统,也可以使用 RPM 安装、删除或更新软件包。要删除发生故障的驱动程序:
- 在引导提示符后用
linux rescue命令引导系统至救援模式,如果需要从驱动盘载入第三方的驱动,可以使用linux rescue dd命令。按照 第 36.1.2 节 “引导至救援模式” 中的说明,同时不要选择以只读模式挂载已安装的系统。 - 将 root 目录改为
/mnt/sysimage/:chroot /mnt/sysimage/ - 使用
rpm -e命令删除驱动程序软件包。例如,要删除 kmod-foobar 驱动程序软件包,请运行:rpm -e kmod-foobar - 退出 chroot 环境:
exit
安装驱动的过程和这类似,但系统中必须有包含驱动程序的 RPM 软件包。
- 在引导提示符后用
linux rescue命令引导系统至救援模式,如果需要从驱动盘载入第三方的驱动,可以使用linux rescue dd命令。按照 第 36.1.2 节 “引导至救援模式” 中的说明,同时不要选择以只读模式挂载已安装的系统。 - 使包含驱动程序的 RPM 软件包可用。例如,挂载 CD 或 USB flash drive 并将 RPM 软件包复制到在
/mnt/sysimage/中选择的位置,如/mnt/sysimage/root/drivers/。 - 将 root 目录改为
/mnt/sysimage/:chroot /mnt/sysimage/ - 使用
rpm -ivh命令安装驱动程序软件包。例如,要安装/root/drivers/中的 kmod-foobar,请运行:rpm -ivh /root/drivers/kmod-foobar-1.2.04.17.el6.i686请注意,这个 chroot 环境中的/root/drivers/是原始救援环境中的/mnt/sysimage/root/drivers/。
完成删除和安装驱动程序后,重启系统。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.