6253 F_GETLK doesn't always return lock owner
[illumos-gate.git] / usr / src / man / man1m / dumpadm.1m
blob8d38d8474d20ae041d944578e281d3a36cf4190a
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 2015 Nexenta Systems, Inc.  All Rights Reserved.
4 .\" Copyright (c) 2013 by Delphix. All rights reserved.
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH DUMPADM 1M "Apr 09, 2015"
9 .SH NAME
10 dumpadm \- configure operating system crash dump
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fB/usr/sbin/dumpadm\fR [\fB-enuy\fR] [\fB-c\fR \fIcontent-type\fR] [\fB-d\fR \fIdump-device\fR]
15      [\fB-m\fR \fImin\fRk | \fImin\fRm | \fImin\fR%] [\fB-s\fR \fIsavecore-dir\fR]
16      [\fB-r\fR \fIroot-dir\fR] [\fB-z\fR on | off]
17 .fi
19 .SH DESCRIPTION
20 .sp
21 .LP
22 The \fBdumpadm\fR program is an administrative command that manages the
23 configuration of the operating system crash dump facility. A crash dump is a
24 disk copy of the physical memory of the computer at the time of a fatal system
25 error. When a fatal operating system error occurs, a message describing the
26 error is printed to the console. The operating system then generates a crash
27 dump by writing the contents of physical memory to a predetermined dump device,
28 which is typically a local disk partition. The dump device can be configured by
29 way of \fBdumpadm\fR. Once the crash dump has been written to the dump device,
30 the system will reboot.
31 .sp
32 .LP
33 Fatal operating system errors can be caused by bugs in the operating system,
34 its associated device drivers and loadable modules, or by faulty hardware.
35 Whatever the cause, the crash dump itself provides invaluable information to
36 your support engineer to aid in diagnosing the problem. As such, it is vital
37 that the crash dump be retrieved and given to your support provider. Following
38 an operating system crash, the \fBsavecore\fR(1M) utility is executed
39 automatically during boot to retrieve the crash dump from the dump device, and
40 write it to the file system. The directory in which the crash
41 dump is saved on reboot can also be configured using \fBdumpadm\fR.
42 .sp
43 .LP
44 When the operating system takes a crash dump the default behavior is to
45 compress the crash dump. This behavior is controlled by the \fB-z\fR option.
46 When compression is turned on, the \fBsavecore\fR(1M) utility writes one file
47 to the file system named \fIvmdump.X\fR. If compression is disabled, it instead
48 writes two files named \fIunix.X\fR and \fIvmcore.X\fR. In the uncompressed
49 case, both data files form the \fIsaved crash dump\fR. In both cases X is an
50 integer identifying the dump.
51 .sp
52 .LP
53 For systems with a UFS root file system, the default dump device is  configured
54 to be an appropriate swap partition. Swap partitions are disk partitions
55 reserved as virtual memory backing store for the operating system. Thus, no
56 permanent information resides in swap to be overwritten by the dump. See
57 \fBswap\fR(1M). For systems with a ZFS root file system, dedicated ZFS volumes
58 are used for swap and dump areas. For further information about setting up a
59 dump area with ZFS,  see the \fIZFS Administration Guide\fR. To view the
60 current dump  configuration, use the \fBdumpadm\fR command with no arguments:
61 .sp
62 .in +2
63 .nf
64 example# \fBdumpadm\fR
66       Dump content: kernel pages
67        Dump device: /dev/dsk/c0t0d0s1 (swap)
68 Savecore directory: /var/crash/saturn
69   Savecore enabled: yes
70    Save compressed: on
71 .fi
72 .in -2
73 .sp
75 .sp
76 .LP
77 When no options are specified, \fBdumpadm\fR prints the current crash dump
78 configuration. The example shows the set of default values: the dump content is
79 set to kernel memory pages only, the dump device is a swap disk partition, the
80 directory for \fBsavecore\fR files is set to
81 \fB/var/crash/\fR\fIhostname\fR\fB,\fR \fBsavecore\fR is set to run
82 automatically on reboot, and compression is turned on.
83 .sp
84 .LP
85 When one or more options are specified, \fBdumpadm\fR verifies that your
86 changes are valid, and if so, reconfigures the crash dump parameters and
87 displays the resulting configuration. You must be \fBroot\fR to view or change
88 dump parameters.
89 .SH OPTIONS
90 .sp
91 .LP
92 The following options are supported:
93 .sp
94 .ne 2
95 .na
96 \fB\fB-c\fR \fIcontent-type\fR\fR
97 .ad
98 .sp .6
99 .RS 4n
100 Modify the dump configuration so that the crash dump consists of the specified
101 dump content. The content should be one of the following:
103 .ne 2
105 \fB\fBkernel\fR\fR
107 .sp .6
108 .RS 4n
109 Kernel memory pages only.
113 .ne 2
115 \fB\fBall\fR\fR
117 .sp .6
118 .RS 4n
119 All memory pages.
123 .ne 2
125 \fB\fBcurproc\fR\fR
127 .sp .6
128 .RS 4n
129 Kernel memory pages, and the memory pages of the process whose thread was
130 currently executing on the CPU on which the crash dump was initiated. If the
131 thread executing on that CPU is a kernel thread not associated with any user
132 process, only kernel pages will be dumped.
138 .ne 2
140 \fB\fB-d\fR \fIdump-device\fR\fR
142 .sp .6
143 .RS 4n
144 Modify the dump configuration to use the specified dump device. The dump device
145 may be one of the following:
147 .ne 2
149 \fB\fIdump-device\fR\fR
151 .sp .6
152 .RS 4n
153 A specific dump device specified as an absolute pathname, such as
154 \fB/dev/dsk/\fR\fIcNtNdNsN\fR when the system is running a UFS root file
155 system. Or, specify a ZFS volume, such as \fB/dev/zvol/dsk/rpool/dump\fR, when
156 the system is running a ZFS root file system.
160 .ne 2
162 \fB\fBswap\fR\fR
164 .sp .6
165 .RS 4n
166 If the special token \fBswap\fR is specified as the dump device, \fBdumpadm\fR
167 examines the  active swap entries and selects the most appropriate entry to
168 configure as the dump device. See \fBswap\fR(1M). Refer to the \fBNOTES\fR
169 below for details of the algorithm  used to select an appropriate swap entry.
170 When the system is first installed with a UFS root file system, \fBdumpadm\fR
171 uses the value for \fBswap\fR to determine the initial dump device setting. A
172 given ZFS volume cannot be configured for both the swap area and the dump
173 device.
177 .ne 2
179 \fB\fBnone\fR\fR
181 .sp .6
182 .RS 4n
183 If the special token \fBnone\fR is specified, the active dump device is removed
184 and crash dumps are disabled.
190 .ne 2
192 \fB\fB-e\fR\fR
194 .sp .6
195 .RS 4n
196 Estimates the size of the dump for the current running system.
200 .ne 2
202 \fB\fB-m\fR \fImin\fR\fBk\fR | \fImin\fR\fBm\fR | \fImin\fR\fB%\fR\fR
204 .sp .6
205 .RS 4n
206 Create a \fBminfree\fR file in the current savecore directory indicating that
207 \fBsavecore\fR should maintain at least the specified amount of free space in
208 the file system where the savecore directory is located. The \fBmin\fR argument
209 can be one of the following:
211 .ne 2
213 \fB\fBk\fR\fR
215 .sp .6
216 .RS 4n
217 A positive integer suffixed with the unit \fBk\fR specifying kilobytes.
221 .ne 2
223 \fB\fBm\fR\fR
225 .sp .6
226 .RS 4n
227 A positive integer suffixed with the unit \fBm\fR specifying megabytes.
231 .ne 2
233 \fB\fB%\fR\fR
235 .sp .6
236 .RS 4n
237 A % symbol, indicating that the \fBminfree\fR value should be computed as the
238 specified percentage of the total current size of the file system containing
239 the savecore directory.
242 The \fBsavecore\fR command will consult the \fBminfree\fR file, if present,
243 prior to writing the dump files. If the size of these files would decrease the
244 amount of free disk space below the \fBminfree\fR threshold, no dump files are
245 written and an error message is logged. The administrator should immediately
246 clean up the savecore directory to provide adequate free space, and re-execute
247 the \fBsavecore\fR command manually. The administrator can also specify an
248 alternate directory on the \fBsavecore\fR command-line.
252 .ne 2
254 \fB\fB-n\fR\fR
256 .sp .6
257 .RS 4n
258 Modify the dump configuration to not run \fBsavecore\fR automatically on
259 reboot. This is not the recommended system configuration; if the dump device is
260 a swap partition, the dump data will be overwritten as the system begins to
261 swap. If \fBsavecore\fR is not executed shortly after boot, crash dump
262 retrieval may not be possible.
266 .ne 2
268 \fB\fB-r\fR \fIroot-dir\fR\fR
270 .sp .6
271 .RS 4n
272 Specify an alternate root directory relative to which \fBdumpadm\fR should
273 create files. If no \fB-r\fR argument is specified, the default root directory
274 \fB/\fR is used.
278 .ne 2
280 \fB\fB-s\fR \fIsavecore-dir\fR\fR
282 .sp .6
283 .RS 4n
284 Modify the dump configuration to use the specified directory to save files
285 written by \fBsavecore\fR. The directory should be an absolute path and exist
286 on the system. If upon reboot the directory does not exist, it will be created
287 prior to the execution of \fBsavecore\fR. See the \fBNOTES\fR section below for
288 a discussion of security issues relating to access to the savecore directory.
289 The default savecore directory is \fB/var/crash/\fIhostname\fR\fR where
290 \fIhostname\fR is the output of the \fB-n\fR option to the \fBuname\fR(1)
291 command.
295 .ne 2
297 \fB\fB-u\fR\fR
299 .sp .6
300 .RS 4n
301 Forcibly update the kernel dump configuration based on the contents of
302 \fB/etc/dumpadm.conf\fR. Normally this option is used only on reboot when
303 starting \fBsvc:/system/dumpadm:default\fR, when the \fBdumpadm\fR settings
304 from the previous boot must be restored. Your dump configuration is saved in
305 the configuration file for this purpose. If the configuration file is missing
306 or contains invalid values for any dump properties, the default values are
307 substituted. Following the update, the configuration file is resynchronized
308 with the kernel dump configuration.
312 .ne 2
314 \fB\fB-y\fR\fR
316 .sp .6
317 .RS 4n
318 Modify the dump configuration to automatically run \fBsavecore\fR on reboot.
319 This is the default for this dump setting.
323 .ne 2
325 \fB\fB-z on | off\fR\fR
327 .sp .6
328 .RS 4n
329 Turns crash dump compression \fBon\fR or \fBoff\fR.
332 .SH EXAMPLES
334 \fBExample 1 \fRReconfiguring The Dump Device To A Dedicated Dump Device:
337 The following command reconfigures the dump device to a dedicated dump device:
340 .in +2
342 example# dumpadm -d /dev/dsk/c0t2d0s2
344            Dump content: kernel pages
345             Dump device: /dev/dsk/c0t2d0s2 (dedicated)
346      Savecore directory: /var/crash/saturn
347        Savecore enabled: yes
348         Save compressed: on
350 .in -2
353 .SH EXIT STATUS
356 The following exit values are returned:
358 .ne 2
360 \fB\fB0\fR\fR
362 .sp .6
363 .RS 4n
364 Dump configuration is valid and the specified modifications, if any, were made
365 successfully.
369 .ne 2
371 \fB\fB1\fR\fR
373 .sp .6
374 .RS 4n
375 A fatal error occurred in either obtaining or modifying the dump configuration.
379 .ne 2
381 \fB\fB2\fR\fR
383 .sp .6
384 .RS 4n
385 Invalid command line options were specified.
388 .SH FILES
390 .ne 2
392 \fB\fB/dev/dump\fR\fR
394 .sp .6
395 .RS 4n
396 Dump device.
400 .ne 2
402 \fB\fB/etc/dumpadm.conf\fR\fR
404 .sp .6
405 .RS 4n
406 Contains configuration parameters for \fBdumpadm\fR. Modifiable only through
407 that command.
411 .ne 2
413 \fB\fIsavecore-directory\fR\fB/minfree\fR\fR
415 .sp .6
416 .RS 4n
417 Contains minimum amount of free space for \fIsavecore-directory\fR. See
418 \fBsavecore\fR(1M).
421 .SH SEE ALSO
424 \fBsvcs\fR(1), \fBuname\fR(1), \fBsavecore\fR(1M), \fBsvcadm\fR(1M),
425 \fBswap\fR(1M), \fBattributes\fR(5), \fBsmf\fR(5)
426 .SH NOTES
429 The system crash dump service is managed by the service management facility,
430 \fBsmf\fR(5), under the service identifier:
432 .in +2
434 svc:/system/dumpadm:default
436 .in -2
441 Administrative actions on this service, such as enabling, disabling, or
442 requesting restart, can be performed using \fBsvcadm\fR(1M). The service's
443 status can be queried using the \fBsvcs\fR(1) command.
444 .SS "Dump Device Selection"
447 When the special \fBswap\fR token is specified as the argument to \fBdumpadm\fR
448 \fB-d\fR the utility will attempt to configure the most appropriate swap device
449 as the dump device. \fBdumpadm\fR configures the largest swap block device as
450 the dump device; if no block devices are available for swap, the largest swap
451 entry is configured as the dump device. If no swap entries are present, or none
452 can be configured as the dump device, a warning message will be displayed.
453 While local and remote swap files can be configured as the dump device, this is
454 not recommended.
455 .SS "Dump Device/Swap Device Interaction (UFS File Systems Only)"
458 In the event that the dump device is also a swap device, and the swap device is
459 deleted by the administrator using the \fBswap\fR \fB-d\fR command, the
460 \fBswap\fR command will automatically invoke \fBdumpadm\fR \fB-d\fR \fBswap\fR
461 in order to attempt to configure another appropriate swap device as the dump
462 device. If no swap devices remain or none can be configured as the dump device,
463 the crash dump will be disabled and a warning message will be displayed.
464 Similarly, if the crash dump is disabled and the administrator adds a new swap
465 device using the \fBswap\fR \fB-a\fR command, \fBdumpadm\fR \fB-d\fR \fBswap\fR
466 will be invoked to re-enable the crash dump using the new swap device.
469 Once \fBdumpadm\fR \fB-d\fR \fBswap\fR has been issued, the new dump device is
470 stored in the configuration file for subsequent reboots. If a larger or more
471 appropriate swap device is added by the administrator, the dump device is not
472 changed; the administrator must re-execute \fBdumpadm\fR \fB-d\fR \fBswap\fR to
473 reselect the most appropriate device fom the new list of swap devices.
474 .SS "Minimum Free Space"
477 If the \fBdumpadm\fR \fB-m\fR option is used to create a \fBminfree\fR file
478 based on a percentage of the total size of the file system containing the
479 savecore directory, this value is not automatically recomputed if the file
480 system subsequently changes size.  In this case, the administrator must
481 re-execute \fBdumpadm\fR \fB-m\fR to recompute the \fBminfree\fR value. If no
482 such file exists in the savecore directory, \fBsavecore\fR will default to a
483 free space threshold of one megabyte. If no free space threshold is desired, a
484 minfree file containing size 0 can be created.
485 .SS "Security Issues"
488 If, upon reboot, the specified savecore directory is not present, it will be
489 created prior to the execution of \fBsavecore\fR with permissions 0700 (read,
490 write, execute by owner only) and owner \fBroot\fR. It is recommended that
491 alternate savecore directories also be created with similar permissions, as the
492 operating system crash dump files themselves may contain secure information.