xref: /freebsd/sbin/savecore/savecore.8 (revision 1fa8142d)
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.\" 3. All advertising materials mentioning features or use of this software
138fae3551SRodney W. Grimes.\"    must display the following acknowledgement:
148fae3551SRodney W. Grimes.\"	This product includes software developed by the University of
158fae3551SRodney W. Grimes.\"	California, Berkeley and its contributors.
168fae3551SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
178fae3551SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
188fae3551SRodney W. Grimes.\"    without specific prior written permission.
198fae3551SRodney W. Grimes.\"
208fae3551SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
218fae3551SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228fae3551SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238fae3551SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
248fae3551SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258fae3551SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268fae3551SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278fae3551SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288fae3551SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298fae3551SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308fae3551SRodney W. Grimes.\" SUCH DAMAGE.
318fae3551SRodney W. Grimes.\"
324be4929cSGarrett Wollman.\"     From: @(#)savecore.8	8.1 (Berkeley) 6/5/93
337f3dea24SPeter Wemm.\" $FreeBSD$
348fae3551SRodney W. Grimes.\"
354be4929cSGarrett Wollman.Dd September 23, 1994
368fae3551SRodney W. Grimes.Dt SAVECORE 8
379fe48c6eSRuslan Ermilov.Os
388fae3551SRodney W. Grimes.Sh NAME
398fae3551SRodney W. Grimes.Nm savecore
408fae3551SRodney W. Grimes.Nd "save a core dump of the operating system"
418fae3551SRodney W. Grimes.Sh SYNOPSIS
427c7fb079SRuslan Ermilov.Nm
438fae3551SRodney W. Grimes.Fl c
447c7fb079SRuslan Ermilov.Nm
454c98f36dSDag-Erling Smørgrav.Op Fl fkvz
46edc4f96eSBill Fenner.Op Ar directory Op Ar device ...
478fae3551SRodney W. Grimes.Sh DESCRIPTION
481fa8142dSRuslan ErmilovThe
491fa8142dSRuslan Ermilov.Nm
501fa8142dSRuslan Ermilovutility
51edc4f96eSBill Fennercopies a core dump into
521fa8142dSRuslan Ermilov.Ar directory ,
53edc4f96eSBill Fenneror the current working directory if no
541fa8142dSRuslan Ermilov.Ar directory
55edc4f96eSBill Fennerargument is given,
568fae3551SRodney W. Grimesand enters a reboot message and information about the core dump into
578fae3551SRodney W. Grimesthe system log.
588fae3551SRodney W. Grimes.Pp
598fae3551SRodney W. GrimesThe options are as follows:
60f9b52c93SPhilippe Charnier.Bl -tag -width indent
618fae3551SRodney W. Grimes.It Fl c
62f9b52c93SPhilippe CharnierClear the dump, so that future invocations of
63f9b52c93SPhilippe Charnier.Nm
648fae3551SRodney W. Grimeswill ignore it.
658fae3551SRodney W. Grimes.It Fl f
66edc4f96eSBill FennerForce a dump to be taken even if the dump was cleared.
674c98f36dSDag-Erling Smørgrav.It Fl k
684c98f36dSDag-Erling SmørgravDo not clear the dump after saving it.
698fae3551SRodney W. Grimes.It Fl v
70f9b52c93SPhilippe CharnierPrint out some additional debugging information.
718fae3551SRodney W. Grimes.It Fl z
72f9b52c93SPhilippe CharnierCompress the core dump and kernel (see
73dff462c3SKris Kennaway.Xr gzip 1 ) .
748fae3551SRodney W. Grimes.El
758fae3551SRodney W. Grimes.Pp
761fa8142dSRuslan ErmilovThe
771fa8142dSRuslan Ermilov.Nm
781fa8142dSRuslan Ermilovutility
79edc4f96eSBill Fennerlooks for dumps on each device specified by the
80edc4f96eSBill Fenner.Ar device
81edc4f96eSBill Fennerargument(s), or on each device in
82edc4f96eSBill Fenner.Pa /etc/fstab
831fa8142dSRuslan Ermilovmarked as
841fa8142dSRuslan Ermilov.Dq dump
851fa8142dSRuslan Ermilovor
861fa8142dSRuslan Ermilov.Dq swap .
871fa8142dSRuslan ErmilovThe
881fa8142dSRuslan Ermilov.Nm
891fa8142dSRuslan Ermilovutility
90edc4f96eSBill Fennerchecks the core dump in various ways to make sure that it is complete.
918fae3551SRodney W. GrimesIf it passes these checks, it saves the core image in
928fae3551SRodney W. Grimes.Ar directory Ns Pa /vmcore.#
93edc4f96eSBill Fennerand information about the core in
94edc4f96eSBill Fenner.Ar directory Ns Pa /info.#
958fae3551SRodney W. GrimesThe ``#'' is the number from the first line of the file
968fae3551SRodney W. Grimes.Ar directory Ns Pa /bounds ,
978fae3551SRodney W. Grimesand it is incremented and stored back into the file each time
98f9b52c93SPhilippe Charnier.Nm
998fae3551SRodney W. Grimessuccessfully runs.
1008fae3551SRodney W. Grimes.Pp
1011fa8142dSRuslan ErmilovThe
1021fa8142dSRuslan Ermilov.Nm
1031fa8142dSRuslan Ermilovutility
1048fae3551SRodney W. Grimesalso checks the available disk space before attempting to make the copies.
1058fae3551SRodney W. GrimesIf there is insufficient disk space in the filesystem containing
1068fae3551SRodney W. Grimes.Ar directory ,
1078fae3551SRodney W. Grimesor if the file
1088fae3551SRodney W. Grimes.Ar directory Ns Pa /minfree
1098fae3551SRodney W. Grimesexists and the number of free kilobytes (for non-superusers) in the
1108fae3551SRodney W. Grimesfilesystem after the copies were made would be less than the number
1118fae3551SRodney W. Grimesin the first line of this file, the copies are not attempted.
1128fae3551SRodney W. Grimes.Pp
1138fae3551SRodney W. GrimesIf
114f9b52c93SPhilippe Charnier.Nm
1158fae3551SRodney W. Grimessuccessfully copies the kernel and the core dump, the core dump is cleared
1168fae3551SRodney W. Grimesso that future invocations of
117f9b52c93SPhilippe Charnier.Nm
1188fae3551SRodney W. Grimeswill ignore it.
1198fae3551SRodney W. Grimes.Pp
1201fa8142dSRuslan ErmilovThe
1211fa8142dSRuslan Ermilov.Nm
1221fa8142dSRuslan Ermilovutility
1238fae3551SRodney W. Grimesis meant to be called near the end of the initialization file
1248fae3551SRodney W. Grimes.Pa /etc/rc
1258fae3551SRodney W. Grimes(see
1268fae3551SRodney W. Grimes.Xr rc 8 ) .
1278fae3551SRodney W. Grimes.Sh BUGS
128edc4f96eSBill FennerThe minfree code does not consider the effect of compression or sparse files.
1298fae3551SRodney W. Grimes.Sh SEE ALSO
130dff462c3SKris Kennaway.Xr gzip 1 ,
131e8ae41c3SRuslan Ermilov.Xr getbootfile 3 ,
132e2fb2db5SNick Hibma.Xr dumpon 8 ,
1338fae3551SRodney W. Grimes.Xr syslogd 8
1348fae3551SRodney W. Grimes.Sh HISTORY
1358fae3551SRodney W. GrimesThe
1368fae3551SRodney W. Grimes.Nm
1378fae3551SRodney W. Grimescommand appeared in
1388fae3551SRodney W. Grimes.Bx 4.1 .
139