savecore saves a core dump of the kernel (assuming that one was made) and writes a reboot message in the shutdown log. It is meant to be called near the end of the /etc/init.d/sysetup file after the system boots. However, it is not normally run by default; you must edit that file to enable it.
savecore checks the core dump to be certain it corresponds with the version of the operating system currently running. If it does, savecore saves the core image in the file directory/vmcore.n and the kernel's namelist in directory/unix.n. The trailing .n in the pathnames is replaced by a number which grows every time savecore is run in that directory.
Before savecore writes out a core image, it reads a number from the file directory/minfree. This is the minimum number of kilobytes that must remain free on the file system containing directory. If there is less free space on the file system containing directory than the number of kilobytes specified in minfree, the core dump is not saved. If the minfree file does not exist, savecore always writes out the core file (assuming that a core dump was taken).
savecore also logs a reboot message using facility LOG_AUTH (see syslog.3 If the system crashed as a result of a panic, savecore logs the panic string too.
If the core dump corresponds to a namelist other than the currently running kernel (represented by /dev/ksyms ) that namelist must be supplied as system-name.
savecore can be fooled into thinking a core dump is the wrong size.
You must run savecore very soon after booting -- before the swap space containing the crash dump is overwritten by programs currently running.
Core images produced by SPARCstation1 systems, and from machines with discontiguous physical memory, are sparse and contain holes. For example, a core image of an 8 megabyte SPARCstation 1 might contain 3 to 4 megabytes of useful information, and thus only occupy 3 to 4 megabytes of disk space, yet contain enough holes to appear to be 36 megabytes in size. However, copying the core image will manifest the holes, so that this copy will require 36 megabytes of disk space. If it is necessary to move a core image, it is strongly recommended that the core image be compressed with compress.1 before the transfer. The compressed image may later be uncompressed on a system with sufficient disk space.
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97