Tuesday, May 26, 2015

RHEL - How to generate a crash dump on Redhat

How to generate a crash dump on Redhat


1. Install following Packages
# rpm -qa | grep -i dump # kdump must be installed.
# yum install kexec-tools crash kernel-debuginfo kernel-debuginfo-common system-config-kdump

2. Edit the /boot/grub/grub.conf
on the kernel line on /boot/grub/grub.conf file, append crashkernel=512M@256M

kernel /vmlinuz-2.6.32-504.1.3.el6.x86_64 .....  crashkernel=512M@256M

or

If you are on GUI
Run the command system-config-kdumpIn and on target settings tab, select the appropriate path and the partition value
Click apply and reboot the system.

3. Modify the config file /etc/kdump.conf to specify the dump location.

# more /etc/kdump.conf
path /opt/crash
core_collector makedumpfile -c --message-level 1 -d 31
default reboot

4. Restart the kdump service
# chkconfig kdump on
# service kdump stop/start
It will create new kdump boot image..

5. Reboot the server
# reboot

6. Core will be generated but may take time to complete.

Locate the core
# echo c > /proc/sysrq-trigger

7. Analyze the core
# ls /var/crash
# ls -l /opt/crash/127.0.0.1-2015-05-08-09\:24\:46/vmcore
# crash ls -l /opt/crash/127.0.0.1-2015-05-08-09\:24\:46/vmcore /usr/lib/debug/lib/modules/`uname -r`/vmlinux

Available Commands:
crash> help
crash> sys
crash> bt -a
crash> mod
crash> log

do man crash for more info..
crash> sys

No comments:

Post a Comment