savecore(1M)
NAME
savecore − save a core dump of the operating system
SYNOPSIS
/sbin/savecore [-cflrvxzZ] [-D dumpdevice] [-O offset] [-m minfree] [-s chunksize] [-t tapedevice] [-w 0| 1 |2] [dirname]
Obsolescent Options:
savecore [-n] [-d dumpsystem]
The -i, -u, -k, -F, -s, and -p options are obsolescent and will be ignored.
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.
dirname is the name of the existing directory in which to store the core dump; the default is /var/adm/crash.
savecore saves the core image and related files in the directory dirname/core.n. (The format of this directory is described in savecore(4)). The trailing n in the directory name is a number that increases by one every time savecore is run with the same dirname. This number is kept in the file dirname/bounds, which is created if it does not already exist.
By default, /stand/vmunix is used as the name of the kernel module saved by savecore. If /stand/vmunix was not the running kernel at the time of the crash, the -d option should be used to specify the kernel.
When savecore writes out a core dump directory, it checks the space available on the file system containing dirname. savecore will not use that portion of the file system space which is reserved for the superuser. Additional space on the file system can be reserved for other uses with -m, or with the dirname/minfree file (obsolescent). This option is useful for ensuring enough file system space for normal system activities after a panic. Note that the -m option is by default in kBytes, whereas the dirname/minfree file value is assumed to be in 512-byte blocks.
If there is insufficient space in the file system for the entire core dump, savecore will save as much of the dump as will fit in the available space. (Priority is given to the index file, then to the kernel module files, starting with the earliest loaded, and then to the physical memory image starting at the lowest addresses and working up.) The dump will be considered saved, and savecore will not attempt to save it again, unless there was insufficient space for even a single chunk. (See the description of option -r.)
savecore also writes a reboot message in the shutdown log file ( /etc/shutdownlog), 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.
By default, when the primary paging device is not used as one of the dump devices or when the core image on the primary paging device is saved, savecore runs in the background. This reduces system boot-up time by allowing the system to be run with only the primary paging device.
It is possible for dump devices to be used also as paging devices. If savecore determines that a dump device is already enabled for paging, and that paging activity has already taken place on that device, a warning message will indicate that the dump may be invalid. If a dump device has not already been enabled for paging, savecore prevents paging from being enabled to the device by creating the file /etc/savecore.LCK. swapon does not enable the device for paging if the device is locked in /etc/savecore.LCK (see swapon(1M) for more details). As savecore finishes saving the image from each dump device, it updates the /etc/savecore.LCK file and optionally executes swapon to enable paging on the device.
Options
-c Mark the dump in the dump device as saved, without performing any other action. The -c option is useful for manually inhibiting dump actions called by /sbin/init.d/savecore.
-f Run savecore in the foreground only. By default, savecore runs in the background when the primary paging device does not contain an unsaved portion of the core image. Turning this option on increases system boot-up time.
-l Logs the panic information to /etc/shutdownlog as described above, but does not actually save the dump. The dump is marked as saved so that future invocations of savecore do not create duplicate log entries.
-r Resaves a dump that a previous invocation of savecore has marked as already saved. This is useful if the first invocation saved only a partial dump, and enough space has been freed to try to save a complete dump.
-v Enables additional progress messages and diagnostics.
-x This option is used to extract a core dump and system from a specified tape device, from a tape written by a previous invocation of savecore (perhaps on a different system). A tape device must be specified with -t to use this option.
-z savecore will compress all physical memory image files and kernel module files in the dump directory.
-Z savecore will not compress any files in the dump directory.
If neither -z nor -Z is specified, savecore will determine whether or not to compress files based on the file sizes involved and the amount of available file system space. Compression may take place in the background after the image has been saved or in the foreground while saving the image, depending on available disk space.
-n (Obsolescent) Copies of the kernel module files are omitted from the dump directory. Only the physical memory image is saved.
-D dumpdevice dumpdevice is the name of the device containing the header of the raw core image. The console messages from the time of the panic will identify the major and minor numbers of this device. This option, in combination with -O, can be used to tell savecore where to find the dump in the rare instances that savecore doesn’t know where to look. (See "Problems and Remedies," below.)
-O offset offset is the offset in kBytes, relative to the beginning of the device specified with -D above, of the header of the raw core image. The console messages from the time of the panic will identify this offset. This option, in combination with -D, can be used to tell savecore where to find the dump in the rare instances that savecore doesn’t know where to look. (See "Problems and Remedies," below.)
-m minfree minfree is the amount of free space (in kBytes) that must remain free for ordinary user files after savecore completes, in addition to space reserved for the superuser. If necessary, only part of the dump will be saved to achieve this requirement. minfree may be specified in bytes (b), kilobytes (k), megabytes (m), or gigabytes (g). The default minfree value is zero, and the default unit is kilobytes. This option will override the value in the dirname/minfree file, if it exists.
-s chunksize chunksize is the size (default kBytes) of a single physical memory image file before compression (see savecore(4)). The kByte value must be a multiple of page size (divisible by 4) and between 64 and 1048576. chunksize may be specified in units of bytes (b), kilobytes (k), megabytes (m), or gigabytes (g). Larger numbers increase compression efficiency at the expense of both savecore time and debugging time. If -s is not specified, a default is chosen based on the physical memory size and the amount of available file system space.
-t tapedevice This option is used to identify a tape device. If -t is specified without -x, the core dump will be written to tapedevice . If this option is specified with -x, the core dump will be read from the tapedevice and written to dirname.
-w n Defines the interaction between savecore and swapon. n can be one of the following values:
0 Do not run swapon from savecore.
1 (default) Call swapon each time savecore finishes saving the image from each dump device. This option provides the most efficient use of paging space.
2 Only call swapon when savecore finishes saving the image file from all dump devices. If this option is used, no additional paging space other than the primary paging space is available until the complete core dump image is saved. This option provides a second chance to retrieve the core image if savecore fails on first attempt.
-d dumpsystem (Obsolescent) 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 this option is not specified, savecore assumes the image is /stand/vmunix. This option may also be used when the system being booted to save the core dump differs from the system that crashed.
RETURN VALUE
Upon exit, savecore returns the following values:
0 A core dump was found and saved.
1 A core dump could not be saved due to an error.
2 No core dump was found to save.
3 A partial core dump was saved, but there was insufficient space to save the complete dump.
PROBLEMS AND REMEDIES
No Dump Was Saved
Cause: The system may have shut down successfully.
Remedy: No dump is expected. Core dumps are only created for abnormal shutdowns.
Cause: savecore may not have been run.
Remedy: savecore must be enabled in the /sbin/rc.config.d/savecore configuration script, or run manually.
Cause: There may not be enough space to save a dump.
Remedies: See below under "Parts of the Dump Are Missing."
Cause: The system may not have dumped successfully.
Remedy: Examine the console messages from the time when the system went down. Error messages there should point to the problem.
Cause: savecore may not know where to look for the dump. (If not, it will say so.)
Remedy: Examine the console messages from the time when the system went down to determine where the dump header is stored. Rerun savecore using the -D and -O options to tell it where the dump header is located.
Cause: System paging activity may have overwritten the dump. (A warning will be displayed indicating that paging activities have modified the dump device.)
Remedy: The dump cannot be saved. To avoid repetition of the problem, use a device other than your primary paging partition for dumps, and/or run savecore early in the system boot process (as is done by the /sbin/init.d/savecore startup script) to save the dump before much paging activity can occur.
Cause: The device numbers encoded in the dump header may not identify the same devices as they did when the system dumped. This can happen if the system was booted from a different boot device in order to run savecore. Error messages stating that no device file could be found corresponding to a particular device number are a likely symptom of this problem.
Remedy: savecore must be run from a boot device that uses the same I/O configuration as the system that dumped.
Parts of the Dump Are Missing
Cause: Insufficient space to save a complete core dump.
Remedies: Try one or more of the following steps to relieve the space constraints. Remember to use -r to override the fact that the dump has already been saved.
Free up space on the file system.
Reduce the minfree value specified with -m or the dirname/minfree file, if applicable.
Use a different file system.
Enable compression.
Increase the chunk size, to improve compression efficiency.
Save the core dump to tape, and restore it on a system with more disk space.
Saving a Dump Takes Too Long
Cause: Time is being taken to compress files while saving core.
Remedies: Disable compression, or free up disk space so that compression can occur in the background after the dump has been saved.
Cause: savecore is running in the foreground to avoid contention for paging space.
Remedies: Do not specify -f. Use different devices for paging and dumps.
Cause: Slow disk accesses.
Remedy: Use a dump device that is fast and tuned for very large data transfers.
WARNINGS
savecore relies on the expectation that device numbers have the same meaning (point to the same devices) at the time the system dumps and at the time the dump is saved. If, after a crash, the system was booted from a different boot device in order to run savecore, it is possible that this expectation will not be met. If so, savecore may save an incomplete or incorrect dump or may fail to save a dump at all. Such cases cannot be reliably detected, so there may be no warning or error message.
AUTHOR
savecore was developed by HP and the University of California, Berkeley.
FILES
/etc/shutdownlog shutdown log
/etc/rc.config.d/savecore savecore startup configuration file
/sbin/init.d/savecore savecore startup file
dirname/bounds crash dump number
dirname/minfree (Obsolescent) minimum free space required after savecore finishes
/stand/vmunix default kernel image saved by savecore
SEE ALSO
adb(1), savecore(4), swapon(1M).
Hewlett-Packard Company — HP-UX Release 10.20: July 1996