CentOS/RHEL kdump报错“设备上没有剩余空间”

问题

无法生成 kdump 并失败并出现以下错误:

Checking for memory holes : [100.0 %] | copy_bitmap_file: Can't write the bitmap(/tmp/kdump_bitmapQijuck). No space left on device"
kdump: dump target is /dev/[ 14.793505] EXT4-fs (dm-0): re-mounted. Opts: (null)
mapper/VGExaDb-kdump_vol
kdump: saving to /kdumproot/kdump/u01/crashfiles/127.0.0.1-2020-04-29-09:46:31/
kdump: saving vmcore-dmesg.txt
kdump: saving vmcore-dmesg.txt complete
kdump: saving vmcore
The kernel version is not supported.
The makedumpfile operation may be incomplete.
Checking for memory holes : [100.0 %] | copy_bitmap_file: Can't write the bitmap(/tmp/kdump_bitmapQijuck). No space left on device
create_2nd_bitmap: Can't copy 1st-bitmap to 2nd-bitmap.
makedumpfile Failed.
kdump: saving vmcore failed
touch: cannot touch '/kdumproot/u01/crashfiles/kdump_post.log': No such file or directory
tee: /kdumproot/u01/crashfiles/kdump_post.log: No such file or directory
2020-04-29 09:46:38 +0200 [INFO] Started kdump post
tee: /kdumproot/u01/crashfiles/kdump_post.log: No such file or directory
https://onitroad.com 更多教程

解决方案

Kdump initramfs 无法获取真实硬盘空间以转储核心。

由于巨大的内存系统需要一些地方让 makedumpfile 工作并标记包含/排除的内存页面。
将 -work-dir 添加到将使用实际磁盘而不是 kdump ramdisk 的 makedumpfile 命令。

  1. 编辑 /etc/kdump.conf 文件如下,并添加 -work-dir=/kdumproot/kdump/u01/crashfiles 条目。
# vi /etc/kdump.conf
core_collector makedumpfile -p -d 31 --work-dir=/kdumproot/kdump/u01/crashfiles
  1. 重启kdump服务:
# systemctl restart kdump

请注意,为 --work-dir 设置的路径来自以下消息:

kdump: saving to /kdumproot/kdump/u01/crashfiles/127.0.0.1-2020-04-29-09:46:31/
日期:2020-09-17 00:14:01 来源:oir作者:oir