kdump – use cases for setting the path

Here, we will see few use cases on how to set path in kdump configuration.
Case 1 – /var/crash part of root file system
[root@ayl-7 ~]# cat /etc/kdump.conf
path /var/crash
core_collector makedumpfile -l --message-level 1 -d 31
[root@ayl-7 ~]# echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger
After crash, you can see:
[root@ayl-7 ~]# ll /var/crash/
total 0
drwxr-xr-x. 2 root root 44 Jul 18 17:07 127.0.0.1-2020-07-18-17:07:00
Case 2 – /var/crash is mounted from different filesystem

Here we have to specify the device name, and path should be / (relative)

[root@ayl-7 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
...
/dev/mapper/crash-crash 25G 45M 24G 1% /var/crash
[root@ayl-7 ~]# cat /etc/kdump.conf
ext4 /dev/mapper/crash-crash
path /
core_collector makedumpfile -l --message-level 1 -d 31
[root@ayl-7 ~]# date
Sat Jul 18 17:32:01 IST 2020
[root@ayl-7 ~]# echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger

After crash, you can see:

[root@ayl-7 ~]# ll /var/crash/
total 20
drwxr-xr-x. 2 root root 4096 Jul 18 17:32 127.0.0.1-2020-07-18-17:32:04
Case 3 – Custom path on different filesystem

Here we are setting path to /storage/crash

[root@ayl-7 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
...
/dev/mapper/crash-crash 25G 94M 24G 1% /storage
[root@ayl-7 ~]# cat /etc/kdump.conf
ext4 /dev/mapper/crash-crash
path /crash
# or
# path crash
core_collector makedumpfile -l --message-level 1 -d 31
[root@ayl-7 ~]# date
Sat Jul 18 17:40:13 IST 2020
[root@ayl-7 ~]# echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger

After crash you can see:

[root@ayl-7 ~]# ll /storage/crash/
total 4
drwxr-xr-x. 2 root root 4096 Jul 18 17:40 127.0.0.1-2020-07-18-17:40:15