第 19 章 分析内核转储
要识别系统崩溃的原因,您可以使用 crash
工具,它提供类似于 GNU Debugger (GDB)的交互式提示。通过使用 crash
,您可以分析由 kdump
、netdump
、diskdump
或 xendump
创建的内核转储以及正在运行的 Linux 系统。另外,您可以使用 Kernel Oops Analyzer 或 Kdump Helper 工具。
19.1. 安装 crash 工具
使用提供的信息,了解所需的软件包,以及安装 crash 工具的流程。默认情况下,在 Red Hat Enterprise Linux 9 系统中可能无法安装 crash
工具。crash
是一个在运行时或内核崩溃发生并创建了内核转储文件时,以交互方式分析系统状态的工具。内核转储文件也称为 vmcore
文件。
流程
启用相关的软件仓库:
# subscription-manager repos --enable baseos repository
# subscription-manager repos --enable appstream repository
# subscription-manager repos --enable rhel-9-for-x86_64-baseos-debug-rpms
安装
crash
软件包:# dnf install crash
安装
kernel-debuginfo
软件包:# dnf install kernel-debuginfo
软件包
kernel-debuginfo
将对应于正在运行的内核,并提供转储分析所需的数据。