Skip to main content

Kdump Configuration Steps








    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

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

Popular posts from this blog

Linux vs Windows

We all know that there are different kinds of OS (Operating Systems). We have a domestic OS called Windows found in every nook and corner of this world, at every desk at least in India. We have flashy, highly sophisticated OS called Macintosh, found in a few rightful hands, where the owner enjoys delicious fruits of this luxurious OS. On the other hand Linux is that type of an OS which plays different roles for its owner/user, found having a friendly relationship with all its owners. :D So, now most of us who are reading this article are fed up of windows licensing problems and planning to migrate from Windows to Linux or you just want to know why Linux guys do not like Windows OS. [Image source: www.superb.net] Here, i would like to tell you one story, Suppose you go to buy a new car, you pay the amount to the respective manufacturer, then you get the keys of your new car, you are with your family very happy to buy a new car. When you drive your car out of the show

LINUX BOOT PROCESS

When you power on your system, you wait for some time and get Linux login prompt, there you enter your password and start your work. Do you ever think what happens when you power on your system ??????? Here I will briefly explain what happens in between power on and log in. Linux boot process explained in 6 stages.                                             1] BIOS [ Basic Input Output System ] After turning on the computer, the BIOS initialize the screen and keyboard and tests the main memory. Up to this stage, the machine does not access any mass storage media. Subsequently, the information about the current date, time, and the most important peripherals are loaded from the CMOS values. BIOS looks for boot loader in floppy, cd-rom, or hard drive. Once the boot loader program is detected it loads boot loader into the memory, and BIOS gives the control to it. 2] MBR [ Master Boot Record ] It is located in the 1st sector of the b

Auto FS

  Mount Filesystem using Auto FS       This document is the Operational Instruction on how to work with Auto FS file system on a Red Hat Linux Server.     This article covers the adding and mounting of Auto FS file system in a Red Hat Linux servers.   Prerequisites      ·          Need to have root privileges to make necessary changes.    ·          Take backup of /etc/exports before making any changes to this file .   ·          On Master Server: Ø   Edit /etc/exports, where an entry for the server and file system needs to be made in the following format:             /abc/pqr/xyz                                            -rw,no_root                                          server1 server2      (Dir that needs to be shared)            (Permissions)                         ( Clients to which the                                                                                                                        the filesystem needs to