Step One: Make sure supportutils has been installed
# rpm -q supportutils
supportutils-3.1.21-150300.7.35.15.1.noarch
(Add: If there is no output, it means supportutils need be installed)
Step Two: Input supportconfig command
# supportconfig
Step One: Make sure supportutils has been installed
# rpm -q supportutils
supportutils-3.1.21-150300.7.35.15.1.noarch
(Add: If there is no output, it means supportutils need be installed)
Step Two: Input supportconfig command
# supportconfig
Input df command and the command is stuck
Can not us cd / command to access /(root) directory
Can not us ls / command to display /(root) directory
There may be some network storage disconnected
# mount
(Add: At this moment, we can see at least one remote storage mount to local directory. If we cd to this directory, system command prompt will output target is busy)
# umount -f <nfs storage which is stuck>
Or:
# umount -l <nfs storage which is stuck>
Or:
# umount -f -l <nfs storage which is stuck>
For RHEL 6, RHEL 7, RHEL 8, RHEL 9
RAM size | Recommended swap size | Recommended swap size if allowing for hibernation |
From 0 to 2GB | 2 times the RAM size | 3 times the RAM size |
From 2GB to 8GB | The same size of the RAM | 2 times the RAM size |
From 8GB to 64GB | At least 4GB | 1.5 times the RAM size |
From 64GB | At least 4GB | Hibernation is not recommended |
Note: A 100GB swap is recommended if system with over 140 logical processes or over 3TB RAM
https://access.redhat.com/solutions/15244
> /var/spool/mail/root
(补充:这里以清空 root 用户的邮箱为例)
# rpm -qa | grep crash || yum install crash ; rpm -qa | grep kernel-debug || yum install kernel-debug
# vim /etc/kdump.conf
修改以下内容:
......
path /var/crash
......
(
补充:
1) 默认的存放位置是 /var/crash
2) 把这里修改成想要存放内核崩溃信息的目录
3) 为了保险起见存放内核崩溃信息的位置最好有大于内存大小的剩余空间
)
# systemctl restart kdump ; systemctl enable kdump
# systemctl status kdump
(补充:当显示输出结果里包含 operational 或者 Active: active (exited) 时,则说明 Kdump 已经启用)
# vim /etc/sysctl.conf
添加以下内容:
......
kernel.hung_task_panic=1
# sysctl -p /etc/sysctl.conf
(步骤略)
(
注意:
1) 只有 task hang 住,或者处理器线程 soft lock 时才会自动产生 dump
2) 此过程系统会自动重启
)
# vim /etc/sysctl.conf
添加以下内容:
......
kernel.sysrq = 1
# sysctl -p /etc/sysctl.conf
同时先后按下以下三个按键:
ALT + PRINTSCREEN + C
(
注意:
1) 此过程会让系统自动重启
2) 只是系统死机并不代表有 kernel panic
)
# vim /etc/sysctl.conf
添加以下内容:
......
kernel.unknown_nmi_panic = 1
kernel.panic_on_unrecovered_nmi = 1
kernel.panic_on_io_nmi = 1
# sysctl -p /etc/sysctl.conf
(步骤略)
# echo c > /proc/sysrq-trigger
(注意:此操作会造成系统重启)
参考文献:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/system_design_guide/installing-and-configuring-kdump_system-design-guide
https://access.redhat.com/solutions/916043
https://access.redhat.com/solutions/3698411
https://access.redhat.com/solutions/6038
https://access.redhat.com/solutions/23069