]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - sbin/savecore/savecore.8
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / sbin / savecore / savecore.8
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     From: @(#)savecore.8    8.1 (Berkeley) 6/5/93
29 .\" $FreeBSD$
30 .\"
31 .Dd December 17, 2012
32 .Dt SAVECORE 8
33 .Os
34 .Sh NAME
35 .Nm savecore
36 .Nd "save a core dump of the operating system"
37 .Sh SYNOPSIS
38 .Nm
39 .Fl c
40 .Op Fl v
41 .Op Ar device ...
42 .Nm
43 .Fl C
44 .Op Fl v
45 .Op Ar device ...
46 .Nm
47 .Op Fl fkvz
48 .Op Fl m Ar maxdumps
49 .Op Ar directory Op Ar device ...
50 .Sh DESCRIPTION
51 The
52 .Nm
53 utility
54 copies a core dump into
55 .Ar directory ,
56 or the current working directory if no
57 .Ar directory
58 argument is given,
59 and enters a reboot message and information about the core dump into
60 the system log.
61 .Pp
62 The options are as follows:
63 .Bl -tag -width ".Fl m Ar maxdumps"
64 .It Fl C
65 Check to see if a dump exists,
66 and display a brief message to indicate the status.
67 An exit status of 0 indicates that a dump is there,
68 1 indicates that none exists.
69 This option is compatible only with the
70 .Op Fl v
71 option.
72 .It Fl c
73 Clear the dump, so that future invocations of
74 .Nm
75 will ignore it.
76 .It Fl f
77 Force a dump to be taken even if either the dump was cleared or if the
78 dump header information is inconsistent.
79 .It Fl k
80 Do not clear the dump after saving it.
81 .It Fl m Ar maxdumps
82 Maximum number of dumps to store.
83 Once the number of stored dumps is equal to
84 .Ar maxdumps
85 the counter will restart from
86 .Dv 0 .
87 .It Fl v
88 Print out some additional debugging information.
89 Specify twice for more information.
90 .It Fl z
91 Compress the core dump and kernel (see
92 .Xr gzip 1 ) .
93 .El
94 .Pp
95 The
96 .Nm
97 utility
98 looks for dumps on each device specified by the
99 .Ar device
100 argument(s), or on each device in
101 .Pa /etc/fstab
102 marked as
103 .Dq dump
104 or
105 .Dq swap .
106 The
107 .Nm
108 utility
109 checks the core dump in various ways to make sure that it is complete.
110 If it passes these checks, it saves the core image in
111 .Ar directory Ns Pa /vmcore.#
112 and information about the core in
113 .Ar directory Ns Pa /info.# .
114 For kernel textdumps generated with the
115 .Xr textdump 4
116 facility, output will be stored in the
117 .Xr tar 5
118 format and named
119 .Ar directory Ns Pa /textdump.tar.# .
120 The
121 .Dq #
122 is the number from the first line of the file
123 .Ar directory Ns Pa /bounds ,
124 and it is incremented and stored back into the file each time
125 .Nm
126 successfully runs.
127 .Pp
128 The
129 .Nm
130 utility
131 also checks the available disk space before attempting to make the copies.
132 If there is insufficient disk space in the file system containing
133 .Ar directory ,
134 or if the file
135 .Ar directory Ns Pa /minfree
136 exists and the number of free kilobytes (for non-superusers) in the
137 file system after the copies were made would be less than the number
138 in the first line of this file, the copies are not attempted.
139 .Pp
140 If
141 .Nm
142 successfully copies the kernel and the core dump, the core dump is cleared
143 so that future invocations of
144 .Nm
145 will ignore it.
146 .Pp
147 The
148 .Nm
149 utility
150 is meant to be called near the end of the initialization file
151 .Pa /etc/rc
152 (see
153 .Xr rc 8 ) .
154 .Sh SEE ALSO
155 .Xr gzip 1 ,
156 .Xr getbootfile 3 ,
157 .Xr textdump 4 ,
158 .Xr tar 5 ,
159 .Xr dumpon 8 ,
160 .Xr syslogd 8
161 .Sh HISTORY
162 The
163 .Nm
164 utility appeared in
165 .Bx 4.1 .
166 .Pp
167 Support for kernel textdumps appeared in
168 .Fx 7.1 .
169 .Sh BUGS
170 The minfree code does not consider the effect of compression or sparse files.