CentOS Stream 9配置kdump与分析vmcore
建议多看red hat官方文档:Analyzing a core dump
1、安装kdump
dnf install kexec-tools
2、配置kdump(/etc/kdump.conf)
```
auto_reset_crashkernel yes
path /var/crash
core_collector makedumpfile -z -d 31 --message-level 1
default reboot
```
3、配置grub(/etc/defalut/grub)
```
GRUB_CMDLINE_LINUX="crashkernel=192M resume=/dev/mapper/cs-swap rd.lvm.lv=cs/root rd.lvm.lv=cs/swap rhgb quiet"
```
4、重启kdump、刷新grub(需重启)
systemctl enable kdump && systemctl restart kdump && grub2-mkconfig -o /boot/grub2/grub.cfg && reboot
5、触发内核崩溃(测试用,会重启)
echo 1 > /proc/sys/kernel/sysrq && echo c > /proc/sysrq-trigger
6、安装crash、对应的debug内核
dnf install crash kernel-debuginfo -y
7、分析vmcore文件
crash /usr/lib/debug/lib/modules/内核名/vmlinux /var/crash/系统自动生成崩溃转存文件夹/vmcore