Red Hat Bugzilla – Bug 219282
/etc/init.d/kdump should call /sbin/makedumpfile instead of cp
Last modified: 2007-11-30 17:07:39 EST
Description of problem:
The kdump init script uses simple and reliable "cp /proc/vmcore /var/crash/...."
to save the crashed kernel's memory image, instead of fancier /sbin/makedumpfile.
The latter program allows useful features like compression or skipping pages,
which in turn permits dramatically smaller disk space consumption.
Please at least make it a sysconfig option for /etc/init.d/kdump to use the
latter tool, if there is some reason not to switch to it wholesale.
Version-Release number of selected component (if applicable):
kexec-tools-1.101-125.el5 (on x86-64)
see /etc/kdump.conf's core_collector option.
The setting exists, but looking at /etc/init.d/kdump, it does not appear
to be actually *used*. It hard-codes "cp" in save_core().
Indeed a test with /etc/kdump.conf with
core_collector makedumpfile -c -d 19
results in an identically large, RAM-size crash image.
you're not using /etc/kdump.conf properly. save_core() is only used if you boot
to the root file system. Ideally you specify a dump target in /etc/kdump.conf,
and mkdumprd (which reads kdump.conf) saves the core to the target location from
the initramfs, using cp or makedumpfile as configured. We had this debate
awhile back about using makedumpfile from the initscript, and the conclusion was
that we assume that if the rootfs gets mounted and init gets run on it, then
something has gone wrong in the initrd, and the save operation failed. As such,
we are in a last ditch effort to save the vmcore,and we want to keep that as
simple as possible (i.e. just try to copy the core, instead of having to read a
config file and determine which utility to use).
This was a vanilla rhel5b2 default installation, and I am in fact happy with
putting crash dumps onto the default /var/crash location. It seems you are
saying that makedumpfile will only be usable if one overrides the default.
Indeed, a new test confirms it. If kdump.conf is given a partition to write
to, and I name the root partition, then the core_collector value is used and
we get a nice small vmcore file. Thank you.
If the default /etc/kdump.conf cannot be changed to activate this feature,
at least consider adding some more commentary to the effect that core_collector
has no effect unless one of the partition designations is also given.
Added additional description to the kexec-kdump-howto.txt in the package docs.
Fix confirmed with kexec-tools-1.101-164.el5.