How to on enable kernel crash dump on Debian Linux

Enabling kernel crash dump on Debian Linux involves several steps, here is an overview of the process:

  1. Install the kexec-tools package:
sudo apt update
sudo apt install kexec-tools
  1. Configure the kernel to use the kdump feature by adding the following line to the /etc/default/grub file:
GRUB_CMDLINE_LINUX_DEFAULT="crashkernel=128M"
  1. Update the grub configuration:
sudo update-grub
  1. Configure the kdump service by editing the /etc/default/kdump-tools file. For example, to configure the service to save core dumps to the /var/crash directory, set the USE_KDUMP variable to 1 and the KDUMP_COREDIR variable to /var/crash.
  2. Start the kdump service:
sudo systemctl start kdump
  1. Enable the kdump service to start automatically at boot time:
sudo systemctl enable kdump

Once the service is enabled and running, the kernel will automatically save a crash dump in the specified directory in case of a crash.

Please note that this is just a basic setup, in order to use it in production environment you should consider security and performance configurations. Also enabling kernel crash dump requires some memory for the crash kernel, so ensure that you have enough memory available.

Leave a Comment