Configuring Kdump for RHEL 6 and 7 High Availability Add-On

Are you tired of dealing with ***** system crashes that leave your data hanging? In this guide, we’ll show you how to configure Kdump on RHEL 6 and 7 High Availability Add-On.

To kick things off, what Kdump is and why it’s so awesome. Essentially, Kdump allows your system to crash gracefully into a separate kernel space instead of just shutting down abruptly. This means that you can capture all the juicy details of the crash and analyze them later on, which can be incredibly helpful for debugging purposes.

Now, let’s get started with configuring Kdump! Here are some simple steps to follow:

Step 1: Enable Kdump in RHEL 6 or 7 High Availability Add-On by running the following command:

# This script enables Kdump in RHEL 6 or 7 High Availability Add-On by configuring the necessary settings.

# Step 1: Enable Kdump in RHEL 6 or 7 High Availability Add-On by running the following command:

# For RHEL 6:
# The following command creates a file named "kernel" in the /etc/sysconfig directory and adds the line "KDUMP=y" to it.
echo "KDUMP=y" > /etc/sysconfig/kernel

# For RHEL 7:
# The following command uses the sed utility to replace the existing value of GRUB_CMDLINE_LINUX in the /etc/default/grub file with "crashkernel=auto rd.lvm.lv=vg00/256M".
# This sets the appropriate kernel parameters for Kdump to work properly.
sed -i 's/^GRUB_CMDLINE_LINUX=""$/GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg00/256M"/' /etc/default/grub

Step 2: Reboot your system to apply the changes and enable Kdump.

Step 3: Verify that Kdump is working by running the following command:

# This script checks if Kdump is enabled on a RHEL 6 or RHEL 7 system.
# It is important to have Kdump enabled in order to capture kernel crash dumps for troubleshooting purposes.

# For RHEL 6:
# The following command checks the value of the 'crash_dump_enabled' parameter in the /proc/sys/kernel directory.
# This parameter should be set to 1 in order for Kdump to be enabled.
cat /proc/sys/kernel/crash_dump_enabled

# For RHEL 7:
# The following command checks the /boot/grub2/grub.cfg file for the presence of the 'KDUMP=' parameter.
# If this parameter is present, it means that Kdump is enabled.
# The 'grep' command searches for the 'KDUMP=' string and the '-q' option suppresses any output.
# If the 'grep' command finds the string, the 'echo' command will print "Kdump is enabled".
# If the 'grep' command does not find the string, the 'echo' command will print "Kdump is not enabled".
grep -q 'KDUMP=' /boot/grub2/grub.cfg && echo "Kdump is enabled" || echo "Kdump is not enabled"

Step 4 (optional): Increase the messaging from makedumpfile for debugging purposes by running:

# This script is used to increase the messaging from makedumpfile for debugging purposes.

# For RHEL 6:
# The following command adds the log level of 10 to the kdump configuration file.
echo "makedumpfile.log_level=10" >> /etc/sysconfig/kdump

# For RHEL 7:
# The following command uses sed to replace the KDUMP_OPTIONS value in the kdump configuration file with a new value that includes a log level of 10 and disables automatic reboot.
sed -i 's/^KDUMP_OPTIONS=""$/KDUMP_OPTIONS="--log-level=10 --no-reboot/"/' /etc/default/grub.d/kdump.conf

Step 5 (optional): Enable sadump for RHEL servers by following the instructions in this guide: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/kernel_administration_guide/configuring_kdump_for_rhel_6_and_7_high_availability_addon

And that’s it! You should now have Kdump up and running on your RHEL 6 or 7 High Availability Add-On. If you ever encounter any issues, don’t hesitate to reach out for help in the comments section below.

SICORPS