1.
In order use the kdump service
on your system, make sure you have the kexec-tools package
installed.
#
rpm –q kexec-tools
2.
If it is not installed
then :
#yum install kexec-tools
3.
Configuring
Boot parameters
-For RHEL 5, edit
/boot/grub/grub.conf
,
and append crashkernel=128M@16M
to the end of the kernel line. {using
@16M on Rhel6 has caused kdump to fail}
- For RHEL 6, use
crashkernel=128M
Below is an example of /boot/grub/grub.conf with the kdump options added for RHEL 5
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub
after making changes to this file
# NOTICE:
You do not have a /boot partition.
This means that
#
all kernel and initrd paths are relative to /, eg.
#
root (hd0,0)
#
kernel /boot/vmlinuz-version ro root=/dev/hda1
#
initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Client
(2.6.17-1.2519.4.21.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.17-1.2519.4.21.el5 ro root=LABEL=/ rhgb quiet crashkernel=128M@16M
initrd /boot/initrd-2.6.17-1.2519.4.21.el5.img
A sample
/boot/grub/grub.conf file on RHEL 6
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to
this file
# NOTICE: You have a /boot
partition. This means that
# all kernel and
initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-220.el6.x86_64)
root (hd0,0)
kernel
/vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/sda3 crashkernel=128M
initrd
/initramfs-2.6.32-220.el6.x86_64.img
After adding the crashkernel parameter the system must be rebooted for the crashkernel memory to be
reserved for use by kdump. This reboot can be performed now or after the below
steps to configure kdump have been completed.
4. Specifying the Kdump Location
Default
option is to store the
vmcore
file in the /var/crash/
directory of the local file system
To guarantee a successful
dump is to have free space on disk at least equal to physical RAM. (/var must be equal to RAM).
Note : This is for large memory
system.
# throw out trival pages and
compress (recommended)
core_collector makedumpfile -d 31 -c
5. Enabling the Service
To start the
kdump
daemon at boot time, type the following at a shell prompt as root
:
# chkconfig kdump on
To start the service in the current session, use the following command as root:
# service kdump start
6. Configure the system to kernel panic on NMI depending on the problem you are attempting to capture. Add these lines to /etc/sysctl.conf and then run sysctl -p as root.
kernel.sysrq = 1 (Apps can be affected by enabling SysRq Key, so need to chk before adding)
kernel.unknown_nmi_panic=1
kernel.panic_on_unrecovered_nmi=1
kernel.panic_on_unrecovered_nmi=1
And loading it for the current boot with "sysctl -p".
[In the case of a hang, you would need to press a specific set of “magic keys” to generate the vmcore]
Alt+SysRq+c / Alt+SysRq+m / https://access.redhat.com/site/node/2023
7. To test this, force-crash the system by triggering a crash with sysrq:
Warning: This will panic your kernel, killing all services on the machine
# echo c > /proc/sysrg-trigger
After making the above changes, the 128M of memory (starting 16M into the memory) is left untouched by the normal system, reserved for the capture kernel.
Take note that the output of free -m shows 128M less memory than without this parameter, which is expected.
Thank You ! Keep Learning!
Comments
Post a Comment