Enabling kernel crash dump on Debian Linux involves several steps, here is an overview of the process:
- Install the
kexec-tools
package:
sudo apt update
sudo apt install kexec-tools
- 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"
- Update the grub configuration:
sudo update-grub
- 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 theUSE_KDUMP
variable to1
and theKDUMP_COREDIR
variable to/var/crash
. - Start the
kdump
service:
sudo systemctl start kdump
- 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.