SAVECORE(8)

NAME
savecore - save a core dump of the operating system

SYNOPSIS
/usr/etc/savecore [ -d dumpstring ] [ -C ] [ -P processes ] [ -s seg_size ] dirname [ system ]

/usr/etc/savecore [ -d dumpstring ] -c

/usr/etc/savecore [ -d dumpstring ] -q

DESCRIPTION
Savecore is meant to be called near the end of the /etc/rc file. Its function is to save the core dump of the system (assuming one was made) and to write a reboot message in the shutdown log.

Savecore saves the core image in the file dirname/vmcore.n or dirname/vmcore.n.ZZ if either the -C flag is specified, or cdump(8s) was used for taking the memory dump. If the core dump corresponds with the current running dynix, or the dynix specified in system, it is saved in dirname/dynix.n. Savecore does not verify if the core dump corresponds with the current running dynix, when restoring or creating compressed dumps. The trailing ".n" in the pathnames is replaced by a number which grows every time savecore is run in that directory. Savecore also saves the output from /etc/dmesg(8) into dirname/dmesg.n.

Before savecore writes out a core image, it reads a number from the file dirname/minfree. If there are fewer free blocks on the filesystem which contains dirname than the number obtained from the minfree file, the core dump is not done. If the minfree file does not exist, savecore always writes out the core file (assuming that a core dump was taken).

Savecore also writes a reboot message in the shut down log. If the system crashed as a result of a panic, savecore records the panic string in the shut down log too.

If the core dump was from a system other than /dynix, the name of that system must be supplied as sysname.

If savecore is invoked with -c, the dump, if one exists, is cleared (that is, discarded).

If savecore is invoked with -q, savecore checks to see if a dump exists. If a dump exists, ``Dump exists.'' is printed. Otherwise, ``No dump.'' is printed.

If savecore is invoked with -C , it writes the vmcore in a compressed format and adds ".ZZ" to the end of the vmcore filename. With -C specified, the option -P specifies how many parallel processes should be used for compressing the input. The default is one for each engine on-line, which is the optimum amount of parallelism. Finally, with -C specified, -s may be specified to fine-tune compression performance; the default value(8k) was selected to optimize crash(8) performance.

If cdump was used for taking the memory dump, savecore writes the vmcore in a compressed format, and adds ".ZZ" to the vmcore filename. When savecore saves such a compressed dump (produced by cdump), it prints out both the real size of memory, and the size of the compressed image it is restoring. The -C option is ignored when saving a dump produced by cdump, because it is already in a compressed form.

If savecore is invoked with -d followed by a dumpstring of the form "offset device", it will use this dumpstring instead of the system default dumpstring. A dumpstring of the form "-f dumplist" will tell savecore to use the named dumplist file.

An example of specifying an alternative dumpstring looks like:

    savecore -d "1000 /dev/zd0b"

The command to have savecore look in /etc/DUMPLIST for dumpstrings would look like:

    savecore -d "-f /etc/DUMPLIST"

FILES
/usr/adm/shutdownlog	shut down log
/dynix	current DYNIX

SEE ALSO
dump(8S) cdump(8s) crash(8) ccompress(8) unccompress(8)

BUGS
The -c option of savecore clears a dump by zeroing the magic number (if it exists) held on the swap partition. If this location is being used for swapping, it can become corrupted. The chance of this happening is very small.

The -C option of savecore will not work if the dump was written to tape. Use cdump(8s) if tapes must be used and compression is desired.