xref: /freebsd/sbin/savecore/savecore.8 (revision eeff0b1b)
18fae3551SRodney W. Grimes.\" Copyright (c) 1980, 1991, 1993
28fae3551SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
38fae3551SRodney W. Grimes.\"
48fae3551SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
58fae3551SRodney W. Grimes.\" modification, are permitted provided that the following conditions
68fae3551SRodney W. Grimes.\" are met:
78fae3551SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
88fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
98fae3551SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
108fae3551SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
118fae3551SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
128fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
138fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
148fae3551SRodney W. Grimes.\"    without specific prior written permission.
158fae3551SRodney W. Grimes.\"
168fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
178fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
188fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
198fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
208fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
218fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
228fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
238fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
248fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268fae3551SRodney W. Grimes.\" SUCH DAMAGE.
278fae3551SRodney W. Grimes.\"
284be4929cSGarrett Wollman.\"     From: @(#)savecore.8	8.1 (Berkeley) 6/5/93
297f3dea24SPeter Wemm.\" $FreeBSD$
308fae3551SRodney W. Grimes.\"
31eeff0b1bSPawel Jakub Dawidek.Dd December 17, 2012
328fae3551SRodney W. Grimes.Dt SAVECORE 8
339fe48c6eSRuslan Ermilov.Os
348fae3551SRodney W. Grimes.Sh NAME
358fae3551SRodney W. Grimes.Nm savecore
368fae3551SRodney W. Grimes.Nd "save a core dump of the operating system"
378fae3551SRodney W. Grimes.Sh SYNOPSIS
387c7fb079SRuslan Ermilov.Nm
398fae3551SRodney W. Grimes.Fl c
40349d039bSPawel Jakub Dawidek.Op Fl v
41349d039bSPawel Jakub Dawidek.Op Ar device ...
427c7fb079SRuslan Ermilov.Nm
43628d16a3SDoug Barton.Fl C
44628d16a3SDoug Barton.Op Fl v
45349d039bSPawel Jakub Dawidek.Op Ar device ...
46628d16a3SDoug Barton.Nm
474c98f36dSDag-Erling Smørgrav.Op Fl fkvz
48eeff0b1bSPawel Jakub Dawidek.Op Fl m Ar maxdumps
49edc4f96eSBill Fenner.Op Ar directory Op Ar device ...
508fae3551SRodney W. Grimes.Sh DESCRIPTION
511fa8142dSRuslan ErmilovThe
521fa8142dSRuslan Ermilov.Nm
531fa8142dSRuslan Ermilovutility
54edc4f96eSBill Fennercopies a core dump into
551fa8142dSRuslan Ermilov.Ar directory ,
56edc4f96eSBill Fenneror the current working directory if no
571fa8142dSRuslan Ermilov.Ar directory
58edc4f96eSBill Fennerargument is given,
598fae3551SRodney W. Grimesand enters a reboot message and information about the core dump into
608fae3551SRodney W. Grimesthe system log.
618fae3551SRodney W. Grimes.Pp
628fae3551SRodney W. GrimesThe options are as follows:
63eeff0b1bSPawel Jakub Dawidek.Bl -tag -width ".Fl m Ar maxdumps"
64628d16a3SDoug Barton.It Fl C
65628d16a3SDoug BartonCheck to see if a dump exists,
66628d16a3SDoug Bartonand display a brief message to indicate the status.
67628d16a3SDoug BartonAn exit status of 0 indicates that a dump is there,
68628d16a3SDoug Barton1 indicates that none exists.
69628d16a3SDoug BartonThis option is compatible only with the
70628d16a3SDoug Barton.Op Fl v
71628d16a3SDoug Bartonoption.
728fae3551SRodney W. Grimes.It Fl c
73f9b52c93SPhilippe CharnierClear the dump, so that future invocations of
74f9b52c93SPhilippe Charnier.Nm
758fae3551SRodney W. Grimeswill ignore it.
768fae3551SRodney W. Grimes.It Fl f
775fb7027cSDavid E. O'BrienForce a dump to be taken even if either the dump was cleared or if the
785fb7027cSDavid E. O'Briendump header information is inconsistent.
794c98f36dSDag-Erling Smørgrav.It Fl k
804c98f36dSDag-Erling SmørgravDo not clear the dump after saving it.
81eeff0b1bSPawel Jakub Dawidek.It Fl m Ar maxdumps
82eeff0b1bSPawel Jakub DawidekMaximum number of dumps to store.
83eeff0b1bSPawel Jakub DawidekOnce the number of stored dumps is equal to
84eeff0b1bSPawel Jakub Dawidek.Ar maxdumps
85eeff0b1bSPawel Jakub Dawidekthe counter will restart from
86eeff0b1bSPawel Jakub Dawidek.Dv 0 .
878fae3551SRodney W. Grimes.It Fl v
88f9b52c93SPhilippe CharnierPrint out some additional debugging information.
89ff869641SPhilip PaepsSpecify twice for more information.
908fae3551SRodney W. Grimes.It Fl z
91f9b52c93SPhilippe CharnierCompress the core dump and kernel (see
92dff462c3SKris Kennaway.Xr gzip 1 ) .
938fae3551SRodney W. Grimes.El
948fae3551SRodney W. Grimes.Pp
951fa8142dSRuslan ErmilovThe
961fa8142dSRuslan Ermilov.Nm
971fa8142dSRuslan Ermilovutility
98edc4f96eSBill Fennerlooks for dumps on each device specified by the
99edc4f96eSBill Fenner.Ar device
100edc4f96eSBill Fennerargument(s), or on each device in
101edc4f96eSBill Fenner.Pa /etc/fstab
1021fa8142dSRuslan Ermilovmarked as
1031fa8142dSRuslan Ermilov.Dq dump
1041fa8142dSRuslan Ermilovor
1051fa8142dSRuslan Ermilov.Dq swap .
1061fa8142dSRuslan ErmilovThe
1071fa8142dSRuslan Ermilov.Nm
1081fa8142dSRuslan Ermilovutility
109edc4f96eSBill Fennerchecks the core dump in various ways to make sure that it is complete.
1108fae3551SRodney W. GrimesIf it passes these checks, it saves the core image in
1118fae3551SRodney W. Grimes.Ar directory Ns Pa /vmcore.#
112edc4f96eSBill Fennerand information about the core in
11320ba6b0dSRuslan Ermilov.Ar directory Ns Pa /info.# .
11410187caeSRobert WatsonFor kernel textdumps generated with the
11510187caeSRobert Watson.Xr textdump 4
11610187caeSRobert Watsonfacility, output will be stored in the
11710187caeSRobert Watson.Xr tar 5
11810187caeSRobert Watsonformat and named
11920ba6b0dSRuslan Ermilov.Ar directory Ns Pa /textdump.tar.# .
12020ba6b0dSRuslan ErmilovThe
12120ba6b0dSRuslan Ermilov.Dq #
12220ba6b0dSRuslan Ermilovis the number from the first line of the file
1238fae3551SRodney W. Grimes.Ar directory Ns Pa /bounds ,
1248fae3551SRodney W. Grimesand it is incremented and stored back into the file each time
125f9b52c93SPhilippe Charnier.Nm
1268fae3551SRodney W. Grimessuccessfully runs.
1278fae3551SRodney W. Grimes.Pp
1281fa8142dSRuslan ErmilovThe
1291fa8142dSRuslan Ermilov.Nm
1301fa8142dSRuslan Ermilovutility
1318fae3551SRodney W. Grimesalso checks the available disk space before attempting to make the copies.
1328fae3551SRodney W. GrimesIf there is insufficient disk space in the file system containing
1338fae3551SRodney W. Grimes.Ar directory ,
1348fae3551SRodney W. Grimesor if the file
1358fae3551SRodney W. Grimes.Ar directory Ns Pa /minfree
1368fae3551SRodney W. Grimesexists and the number of free kilobytes (for non-superusers) in the
1378fae3551SRodney W. Grimesfile system after the copies were made would be less than the number
1388fae3551SRodney W. Grimesin the first line of this file, the copies are not attempted.
1398fae3551SRodney W. Grimes.Pp
1408fae3551SRodney W. GrimesIf
141f9b52c93SPhilippe Charnier.Nm
1428fae3551SRodney W. Grimessuccessfully copies the kernel and the core dump, the core dump is cleared
1438fae3551SRodney W. Grimesso that future invocations of
144f9b52c93SPhilippe Charnier.Nm
1458fae3551SRodney W. Grimeswill ignore it.
1468fae3551SRodney W. Grimes.Pp
1471fa8142dSRuslan ErmilovThe
1481fa8142dSRuslan Ermilov.Nm
1491fa8142dSRuslan Ermilovutility
1508fae3551SRodney W. Grimesis meant to be called near the end of the initialization file
1518fae3551SRodney W. Grimes.Pa /etc/rc
1528fae3551SRodney W. Grimes(see
1538fae3551SRodney W. Grimes.Xr rc 8 ) .
1548fae3551SRodney W. Grimes.Sh SEE ALSO
155dff462c3SKris Kennaway.Xr gzip 1 ,
156e8ae41c3SRuslan Ermilov.Xr getbootfile 3 ,
15710187caeSRobert Watson.Xr textdump 4 ,
158138f7e4bSTom Rhodes.Xr tar 5 ,
159e2fb2db5SNick Hibma.Xr dumpon 8 ,
1608fae3551SRodney W. Grimes.Xr syslogd 8
1618fae3551SRodney W. Grimes.Sh HISTORY
1628fae3551SRodney W. GrimesThe
1638fae3551SRodney W. Grimes.Nm
164629e80efSPhilippe Charnierutility appeared in
1658fae3551SRodney W. Grimes.Bx 4.1 .
16610187caeSRobert Watson.Pp
16710187caeSRobert WatsonSupport for kernel textdumps appeared in
1682a72feb4SChristian Brueffer.Fx 7.1 .
1696087df9eSRuslan Ermilov.Sh BUGS
1706087df9eSRuslan ErmilovThe minfree code does not consider the effect of compression or sparse files.
171