1 .\" $NetBSD: savecore.8,v 1.33 2004/10/21 10:13:00 dsainty Exp $
3 .\" Copyright (c) 1980, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)savecore.8 8.1 (Berkeley) 6/5/93
37 .Nd save a core dump of the operating system
55 kernel encounters a fatal error, the
57 routine arranges for a snapshot of the contents of physical memory to
58 be written into a dump area, typically in the swap partition.
60 Upon a subsequent reboot,
62 is typically run out of
64 before swapping is enabled, to copy the kernel and the saved memory image
67 and enters a reboot message and information about the core dump into
70 The kernel and core file can then be analyzed using various tools,
81 to attempt to deduce the cause of the crash.
83 Crashes are usually the result of hardware faults or kernel bugs.
84 If a kernel bug is suspected, a full bug report should be filed at
85 http://www.netbsd.org/, or using
87 containing as much information as possible about the circumstances of
89 Since crash dumps are typically very large and may contain
90 whatever (potentially confidential) information was in memory at the
93 include a copy of the crash dump file in the bug report; instead, save it
94 somewhere in the event that a
96 developer wants to examine it.
98 The options are as follows:
99 .Bl -tag -width directory
101 Only clears the dump without saving it, so that future invocations of
105 Forces a dump to be taken even if the dump doesn't appear correct or there
106 is insufficient disk space.
108 Check whether a dump is present without taking further action.
109 The command exits with zero status if a dump is present, or with non-zero
114 as the kernel instead of the default (returned by
115 .Xr getbootfile 3 ) .
120 to check that kernel file is
126 Prints out some additional debugging information.
128 Compresses the core dump and kernel (see
131 Set the compression level for
135 Defaults to 1 (the fastest compression mode).
138 for more information regarding the compression level.
142 checks the core dump in various ways to make sure that it is current and
143 that it corresponds to the currently running system.
144 If it passes these checks, it saves the core image in
145 .Ar directory Ns Pa /netbsd.#.core
147 .Ar directory Ns Pa /netbsd.#
149 .Ar directory Ns Pa /netbsd.#.core.gz
151 .Ar directory Ns Pa /netbsd.#.gz ,
157 is the number from the first line of the file
158 .Ar directory Ns Pa /bounds ,
159 and it is incremented and stored back into the file each time
164 also checks the available disk space before attempting to make the copies.
165 If there is insufficient disk space in the file system containing
168 .Ar directory Ns Pa /minfree
169 exists and the number of free kilobytes (for non-superusers) in the
170 file system after the copies were made would be less than the number
171 in the first line of this file, the copies are not attempted.
175 successfully copies the kernel and the core dump, the core dump is cleared
176 so that future invocations of
199 The minfree code does not consider the effect of compression.