Linux: Change the crash dump location

When kdump is enabled, the crash dumps are typically written to /var/crash. However, this directory may not always be suitable – especially if it lacks sufficient space. Thankfully, the dump location is configurable.

Follow the steps below to redirect the crash dump to another path.

1. Edit the kdump configuration file /etc/kdump.conf

Find the line that begins with path (or add it if it doesn’t exist), and set it to your desired directory. For example:

path /var2/crash

This tells kdump to save crash dumps to /var2/crash instead of the default /var/crash.

2. Ensure the directory exists and has enough space

Create the new directory if it doesn’t already exist:

# mkdir /var2/crash

Make sure it has appropriate permissions and enough disk space to store crash dumps, which can be large depending on system memory.

3. Restart the kdump service

After making changes, restart the kdump service to apply the new configuration:

# systemctl restart kdump

You can check the status to confirm it’s active:

# systemctl status kdump

● kdump.service - Crash recovery kernel arming
Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2025-07-10 19:42:12 UTC; 10min ago
Main PID: 1162 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 196884)
Memory: 0B
CGroup: /system.slice/kdump.service

Jul 10 19:42:08 rac1.mycompany.mydomain systemd[1]: Starting Crash recovery kernel arming...
Jul 10 19:42:12 rac1.mycompany.mydomain kdumpctl[1428]: kdump: kexec: loaded kdump kernel
Jul 10 19:42:12 rac1.mycompany.mydomain kdumpctl[1428]: kdump: Starting kdump: [OK]
Jul 10 19:42:12 rac1.mycompany.mydomain systemd[1]: Started Crash recovery kernel arming.

⚠️ Important Notes

  • The crash dump directory must be accessible even during a crash, so avoid temporary filesystems (like /tmp) or network paths unless properly configured.
  • For production systems, it’s best to use a dedicated partition or storage volume with enough capacity to hold full memory dumps.

Unknown's avatarAbout Mariami Kupatadze
Oracle Certified Master Linkedin: https://www.linkedin.com/in/mariami-kupatadze-01074722/

Leave a Reply