Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

savecore(1M)

NAME

savecore − save a core dump of the operating system

SYNOPSIS

Series 300, 400, and 700:

/etc/savecore [-nvcpx] [-d dumpsystem] [-t tapedevice] dirname [system]

Series 800:

/etc/savecore [-nvcpxfiukS] [-w[0|1 |2]] [-F corefile] [-d dumpsystem] [-t tapedevice] 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 first checks the space available on the filesystem containing dirname. If there is not enough space available to save the complete core image and the -p option was not specified, savecore prints a message and quits.  Space can be reserved in a filesystem by specifying the number of 512-byte blocks in a file named dirname/minfree.  The minfree file is useful for ensuring enough file system space for normal system activities after a panic. 

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 and -t options are specified, savecore prints an error message and exits. 

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 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. 

Prior to HP-UX Release 9.0, savecore could overflow available file system space while saving the core file.  Beginning at Release 9.0, savecore first checks the available space and the file dirname/minfree (if it exists) before writing out the core file.  If a dirname/minfree file was created prior to Release 9.0 to prevent savecore from consuming excessive file system space, be sure to reexamine the file to make sure it now contains only the number of 512-byte blocks of free space to be available after savecore finishes writing the core file. 

DEPENDENCIES

Series 800:

Multiple dump devices can be configured on Series 800 systems so that large memory configurations can be dumped to a core file that is spread across more than one device if necessary. 

By default, when the primary swap device is not used as one of the dump devices or when the core image on the primary swap 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 swap device. 

If the dump devices are also used as swap devices, savecore disables swapping to those devices by creating the file /etc/savecore.LCK.  swapon does not enable the device for swapping 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 executes swapon to enable swapping on the the device. 

Series 800 Only Options:
On Series 800 systems, the following additional options and command-line arguments are recognized:

-f Run savecore in the foreground only.  By default, savecore runs in the background when the primary swap device does not contain a portion of the core image.  Turning this option on increases system boot-up time. 

-i Selectively retrieve the core file if necessary.  With this option, savecore saves the complete core image if there is enough space on the file system that contains dirname. If there is insufficient space to save the complete core file, savecore saves the kernel pages and possibly user pages, depending on the space available on the file system.  A compact core file is created unless the -S option is specified.  This option is recommended because it tries to save as much important information as possible after each system panic.  Both -u and -k override this option. 

-u Force savecore to save user and kernel pages if space allows.  Overrides the -i option.  A compact core file is created unless -S is specified. 

-k Force to save only kernel pages if space allows.  Overrides the -i option.  A compact core file is created unless -S is specified. 

-w[n] Communicate with swapon.  n can be one of the following values:

0 Do not run swapon from savecore.  Use this option only when swapon is not executed from the /etc/rc file. 

1 (default) Call swapon each time savecore finishes saving the image from each dump device.  This option provides the most efficient use of swap space. 

2 Only call swapon when savecore finishes saving the image file from all dump devices.  If this option is used, no additional swap space other than the primary swap space is available until the complete core dump image is saved.  This option provides a second chance to retrieve the core image when savecore fails on first attempt. 

-S Create a sparsely populated core file instead of a compact one. 

-F corefile Expand the compact core file.  The name of corefile must have a .I suffix.  This option is useful only when preparing the compact core file for analysis.  -S and -d must be used with this option.  The expanded core file (without the .I suffix) is saved in directory dirname.

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

adb(1). 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026