savecore(1M)
NAME
savecore − save a core dump of the operating system
SYNOPSIS
/etc/savecore [−nvcpx] [−ddumpsystem] [−ttapedevice] dirname [system]
DESCRIPTION
savecore saves a core dump of the system (assuming one was made when the system crashed) and writes a reboot message in the shutdown log file. savecore should be executed toward the end of the /etc/rc file.
dirname is the name of the existing directory in which to store the core dump.
system is the name of a file containing the image of the current running system; that is, the system that is running when savecore is executed. If system is not specified, /hp-ux is assumed.
savecore checks the core dump to verify that it corresponds to dumpsystem. If it does, savecore saves the core image in the file dirname/hp-core.n and a copy of dumpsystem, which contains the namelist, in the file dirname/hp-ux.n. The trailing n in the path names is a number that increases by one every time savecore is run in that directory. This number is kept in the file dirname/bounds, which is created if it does not already exist.
Before savecore writes out a core image, it reads a number from the file dirname/minfree. The core dump is not done if the number of free 512-byte blocks on the file system that contains dirname is less than the number obtained from the minfree file. If minfree does not exist, savecore always writes out the core file. Note that repeated system crashes can result in multiple core files that consume large quantities of disk space, especially on machines with large physical memories.
savecore also writes a reboot message in the shutdown log file, if one exists. (If a shutdown log file does not exist, savecore does not create one.) If the system crashes as a result of a panic, savecore also records the panic string in the shutdown log.
Options
−n No copy of the dumpsystem is saved in dirname/hp-ux.n. If −n is used, the user must remember which kernel (for example, /hp-ux) corresponds to the saved core file. The core file alone is not very useful.
−v Additional messages are printed under some conditions. This option is usually used only for debugging.
−c Clear the dump device flag to indicate that the device no longer contains any useful dump information. The −c option is useful for manually inhibiting dump actions called by /etc/rc.
−p Execute a partial dump. The destination file accepts as much of the dump as disk space allows, then clears the dump device flag as though the entire dump succeeded. This is useful when disk space is very low, but some information is still desired.
−x This option is used to extract a core image and system from a specified mag tape device. A mag tape device must be specified to use this option. If −t is not specified, savecore prints an error message and exits.
−d dumpsystem dumpsystem is the name of a file containing the image of the system that produced the core dump (that is, the system running when the crash occurred). If −d is not specified, savecore assumes dumpsystem is identical to system. This option is used when the system being booted to save the core dump differs from the system that crashed. This is usually necessary only when debugging new systems that are not stable enough to boot and run savecore.
−t tapedevice This option is used to identify a mag tape device. If −t is specified without the −x option, the core image and the system will be written to tapedevice . If this option is specified with the −x option, the core image and system will be read from the tapedevice and written to dirname. If both the −n −t options are specified, savecore prints an error message and exits.
RETURN VALUE
savecore returns the following exit status values:
0 A core dump was found and saved.
1 A core dump could not be saved due to an error or minfree limitation.
2 No core dump was found to save.
WARNINGS
Some implementations place the core dump in the disk swap area while the system reboots. On such systems, if too many programs are swapped out before savecore is run, savecore might be unable to recover the crash dump.
savecore cannot recover the crash dump if more than three days have elapsed since the crash occurred. In this case, savecore displays the message, "Dump time is unreasonable".
When the −d option is specified, some implementations require that system and dumpsystem be configured similarly. For example, with some implementations, swap devices must be identically configured, and the amount of physical memory in the system must not change between the time of the crash and the running of savecore.
AUTHOR
savecore was developed by HP and the University of California, Berkeley.
FILES
/hp-ux current system
/usr/adm/shutdownlog shutdown log
dirname/bounds crash dump number
dirname/minfree minimum free blocks on file system
SEE ALSO
Hewlett-Packard Company — HP-UX Release 8.05: June 1991