In this lesson, you will learn how to configure a dedicated crash dump volume to ensure your system can capture vital diagnostic data when a kernel panic occurs.
When a Linux kernel encounters a critical error and panics, it stops executing to prevent data corruption. However, that "freeze" makes it difficult to understand why the system failed. To solve this, we use a utility called kdump. When a panic occurs, kdump boots a secondary, "capture" kernel that saves the memory state (a "vmcore") to your storage.
The Role of Crash Volumes
If your main storage is corrupted during a panic, you cannot save the crash log. To ensure availability, we designate a specific area of storage for these dumps. While you can save them to the root filesystem, it is much safer to reserve a dedicated LVM logical volume or a separate partition for crash dumps. This prevents the primary filesystem from becoming full or inaccessible during the dump process.
Configuring the Dump Target
To set up a dedicated volume, you define the crash target in the /etc/kdump.conf configuration file. For instance, if you have a logical volume named /dev/vg_data/lv_crash, you would specify it like this:
# /etc/kdump.conf
path /var/crash
ext4 /dev/vg_data/lv_crash
By explicitly mounting this volume during the emergency capture process, you isolate the crash data from your primary workload. This ensures that even if your main filesystem was the source of the kernel instability, the capture kernel has a stable, independent place to write the evidence needed for debugging.
Verification
Once configured, you must ensure the service is active and that your system has reserved a portion of RAM for the capture kernel to run in. You can check the status using systemctl status kdump. If the service is running, the kernel is now prepared to offload its memory state to your designated storage volume the moment an unrecoverable failure occurs.
Key Takeaway: By isolating crash dumps onto a dedicated storage volume, you guarantee that diagnostic information remains accessible and protected even when the primary system environment is in an unstable state.