Enabling kernel crash dump on Debian Linux involves several steps, here is an overview of the process:
- Install the
kexec-toolspackage:
sudo apt update
sudo apt install kexec-tools
- Configure the kernel to use the
kdumpfeature by adding the following line to the/etc/default/grubfile:
GRUB_CMDLINE_LINUX_DEFAULT="crashkernel=128M"
- Update the grub configuration:
sudo update-grub
- Configure the
kdumpservice by editing the/etc/default/kdump-toolsfile. For example, to configure the service to save core dumps to the/var/crashdirectory, set theUSE_KDUMPvariable to1and theKDUMP_COREDIRvariable to/var/crash. - Start the
kdumpservice:
sudo systemctl start kdump
- Enable the
kdumpservice 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.