centos 使用 crash 和 kdump

 1 1.首先得安装调试符号
 2 kernel-debuginfo-common-x86_64-4.18.0-240.10.1.el8_3.x86_64.rpm
 3 kernel-debuginfo-4.18.0-240.10.1.el8_3.x86_64.rpm
 4 
 5 2.安装 crash
 6 yum install crash
 7 
 8 3.安装 kdump
 9 yum install kexec-tools
10 
11 
12 4.配置 grub
13 /etc/default/grub 
14 GRUB_CMDLINE_LINUX="crashkernel=256M"
15 
16 5.修改kdump默认配置/etc/kdump.conf
17 https://www.thegeekdiary.com/centos-rhel-7-how-to-configure-kdump/
18 
19 6.启动 kdump 服务
20 systemctl start kdump.service
21 systemctl enable kdump.service
22 
23 7.查看 kdump 服务是否启动
24 service kdump status
25 
26 8.手动触发 kdump
27 echo 1 > /proc/sys/kernel/sysrq
28 echo c > /proc/sysrq-trigger
29 
30 9.查看 crash,并调试
31 ls /var/crash/
32 
33 10. 使用 crash 命令
34 files
35 crash vmlinux vmcore

 

posted @ 2021-02-09 13:51  maojun1998  阅读(676)  评论(0编辑  收藏  举报