Red Hat Training

A Red Hat training course is available for RHEL 8

第 20 章 分析内核转储

要确定系统崩溃的原因,您可以使用 crash 实用程序,它提供了一个与 GNU Debugger (GDB) 类似的交互式提示符。这个工具允许您交互式地分析由 kdumpnetdumpdiskdumpxendump 创建的内核转储以及正在运行的 Linux 系统。另外,您还可以使用 Kernel Oops Analyzer 或者 Kdump Helper 工具。

20.1. 安装 crash 工具

使用提供的信息,了解所需的软件包,以及安装 crash 工具的流程。默认情况下,crash 工具可能没有在 RHEL 8 系统上安装。crash 是一个工具,来在系统运行时或内核崩溃发生及内核转储文件创建后,以交互方式分析系统状态。内核转储文件也称为 vmcore 文件。

流程

  1. 启用相关的软件仓库:

    # subscription-manager repos --enable baseos repository
    # subscription-manager repos --enable appstream repository
    # subscription-manager repos --enable rhel-8-for-x86_64-baseos-debug-rpms
  2. 安装 crash 软件包:

    # yum install crash
  3. 安装 kernel-debuginfo 软件包:

    # yum install kernel-debuginfo

    软件包 kernel-debuginfo 将对应于正在运行的内核,并提供用于转储分析所需的数据。