1 '\" te 2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved 3 .\" Copyright 2013 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 "Feb 15, 2013" 9 .SH NAME 10 dumpadm \- configure operating system crash dump 11 .SH SYNOPSIS 12 .LP 13 .nf 14 \fB/usr/sbin/dumpadm\fR [\fB-nuy\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 18 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 65 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 74 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: 102 .sp 103 .ne 2 104 .na 105 \fB\fBkernel\fR\fR 106 .ad 107 .sp .6 108 .RS 4n 109 Kernel memory pages only. 110 .RE 111 112 .sp 113 .ne 2 114 .na 115 \fB\fBall\fR\fR 116 .ad 117 .sp .6 118 .RS 4n 119 All memory pages. 120 .RE 121 122 .sp 123 .ne 2 124 .na 125 \fB\fBcurproc\fR\fR 126 .ad 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. 133 .RE 134 135 .RE 136 137 .sp 138 .ne 2 139 .na 140 \fB\fB-d\fR \fIdump-device\fR\fR 141 .ad 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: 146 .sp 147 .ne 2 148 .na 149 \fB\fIdump-device\fR\fR 150 .ad 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. 157 .RE 158 159 .sp 160 .ne 2 161 .na 162 \fB\fBswap\fR\fR 163 .ad 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. 174 .RE 175 176 .sp 177 .ne 2 178 .na 179 \fB\fBnone\fR\fR 180 .ad 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. 185 .RE 186 187 .RE 188 189 .sp 190 .ne 2 191 .na 192 \fB\fB-m\fR \fImin\fR\fBk\fR | \fImin\fR\fBm\fR | \fImin\fR\fB%\fR\fR 193 .ad 194 .sp .6 195 .RS 4n 196 Create a \fBminfree\fR file in the current savecore directory indicating that 197 \fBsavecore\fR should maintain at least the specified amount of free space in 198 the file system where the savecore directory is located. The \fBmin\fR argument 199 can be one of the following: 200 .sp 201 .ne 2 202 .na 203 \fB\fBk\fR\fR 204 .ad 205 .sp .6 206 .RS 4n 207 A positive integer suffixed with the unit \fBk\fR specifying kilobytes. 208 .RE 209 210 .sp 211 .ne 2 212 .na 213 \fB\fBm\fR\fR 214 .ad 215 .sp .6 216 .RS 4n 217 A positive integer suffixed with the unit \fBm\fR specifying megabytes. 218 .RE 219 220 .sp 221 .ne 2 222 .na 223 \fB\fB%\fR\fR 224 .ad 225 .sp .6 226 .RS 4n 227 A % symbol, indicating that the \fBminfree\fR value should be computed as the 228 specified percentage of the total current size of the file system containing 229 the savecore directory. 230 .RE 231 232 The \fBsavecore\fR command will consult the \fBminfree\fR file, if present, 233 prior to writing the dump files. If the size of these files would decrease the 234 amount of free disk space below the \fBminfree\fR threshold, no dump files are 235 written and an error message is logged. The administrator should immediately 236 clean up the savecore directory to provide adequate free space, and re-execute 237 the \fBsavecore\fR command manually. The administrator can also specify an 238 alternate directory on the \fBsavecore\fR command-line. 239 .RE 240 241 .sp 242 .ne 2 243 .na 244 \fB\fB-n\fR\fR 245 .ad 246 .sp .6 247 .RS 4n 248 Modify the dump configuration to not run \fBsavecore\fR automatically on 249 reboot. This is not the recommended system configuration; if the dump device is 250 a swap partition, the dump data will be overwritten as the system begins to 251 swap. If \fBsavecore\fR is not executed shortly after boot, crash dump 252 retrieval may not be possible. 253 .RE 254 255 .sp 256 .ne 2 257 .na 258 \fB\fB-r\fR \fIroot-dir\fR\fR 259 .ad 260 .sp .6 261 .RS 4n 262 Specify an alternate root directory relative to which \fBdumpadm\fR should 263 create files. If no \fB-r\fR argument is specified, the default root directory 264 \fB/\fR is used. 265 .RE 266 267 .sp 268 .ne 2 269 .na 270 \fB\fB-s\fR \fIsavecore-dir\fR\fR 271 .ad 272 .sp .6 273 .RS 4n 274 Modify the dump configuration to use the specified directory to save files 275 written by \fBsavecore\fR. The directory should be an absolute path and exist 276 on the system. If upon reboot the directory does not exist, it will be created 277 prior to the execution of \fBsavecore\fR. See the \fBNOTES\fR section below for 278 a discussion of security issues relating to access to the savecore directory. 279 The default savecore directory is \fB/var/crash/\fIhostname\fR\fR where 280 \fIhostname\fR is the output of the \fB-n\fR option to the \fBuname\fR(1) 281 command. 282 .RE 283 284 .sp 285 .ne 2 286 .na 287 \fB\fB-u\fR\fR 288 .ad 289 .sp .6 290 .RS 4n 291 Forcibly update the kernel dump configuration based on the contents of 292 \fB/etc/dumpadm.conf\fR. Normally this option is used only on reboot when 293 starting \fBsvc:/system/dumpadm:default\fR, when the \fBdumpadm\fR settings 294 from the previous boot must be restored. Your dump configuration is saved in 295 the configuration file for this purpose. If the configuration file is missing 296 or contains invalid values for any dump properties, the default values are 297 substituted. Following the update, the configuration file is resynchronized 298 with the kernel dump configuration. 299 .RE 300 301 .sp 302 .ne 2 303 .na 304 \fB\fB-y\fR\fR 305 .ad 306 .sp .6 307 .RS 4n 308 Modify the dump configuration to automatically run \fBsavecore\fR on reboot. 309 This is the default for this dump setting. 310 .RE 311 312 .sp 313 .ne 2 314 .na 315 \fB\fB-z on | off\fR\fR 316 .ad 317 .sp .6 318 .RS 4n 319 Turns crash dump compression \fBon\fR or \fBoff\fR. 320 .RE 321 322 .SH EXAMPLES 323 .LP 324 \fBExample 1 \fRReconfiguring The Dump Device To A Dedicated Dump Device: 325 .sp 326 .LP 327 The following command reconfigures the dump device to a dedicated dump device: 328 329 .sp 330 .in +2 331 .nf 332 example# dumpadm -d /dev/dsk/c0t2d0s2 333 334 Dump content: kernel pages 335 Dump device: /dev/dsk/c0t2d0s2 (dedicated) 336 Savecore directory: /var/crash/saturn 337 Savecore enabled: yes 338 Save compressed: on 339 .fi 340 .in -2 341 .sp 342 343 .SH EXIT STATUS 344 .sp 345 .LP 346 The following exit values are returned: 347 .sp 348 .ne 2 349 .na 350 \fB\fB0\fR\fR 351 .ad 352 .sp .6 353 .RS 4n 354 Dump configuration is valid and the specified modifications, if any, were made 355 successfully. 356 .RE 357 358 .sp 359 .ne 2 360 .na 361 \fB\fB1\fR\fR 362 .ad 363 .sp .6 364 .RS 4n 365 A fatal error occurred in either obtaining or modifying the dump configuration. 366 .RE 367 368 .sp 369 .ne 2 370 .na 371 \fB\fB2\fR\fR 372 .ad 373 .sp .6 374 .RS 4n 375 Invalid command line options were specified. 376 .RE 377 378 .SH FILES 379 .sp 380 .ne 2 381 .na 382 \fB\fB/dev/dump\fR\fR 383 .ad 384 .sp .6 385 .RS 4n 386 Dump device. 387 .RE 388 389 .sp 390 .ne 2 391 .na 392 \fB\fB/etc/dumpadm.conf\fR\fR 393 .ad 394 .sp .6 395 .RS 4n 396 Contains configuration parameters for \fBdumpadm\fR. Modifiable only through 397 that command. 398 .RE 399 400 .sp 401 .ne 2 402 .na 403 \fB\fIsavecore-directory\fR\fB/minfree\fR\fR 404 .ad 405 .sp .6 406 .RS 4n 407 Contains minimum amount of free space for \fIsavecore-directory\fR. See 408 \fBsavecore\fR(1M). 409 .RE 410 411 .SH SEE ALSO 412 .sp 413 .LP 414 \fBsvcs\fR(1), \fBuname\fR(1), \fBsavecore\fR(1M), \fBsvcadm\fR(1M), 415 \fBswap\fR(1M), \fBattributes\fR(5), \fBsmf\fR(5) 416 .SH NOTES 417 .sp 418 .LP 419 The system crash dump service is managed by the service management facility, 420 \fBsmf\fR(5), under the service identifier: 421 .sp 422 .in +2 423 .nf 424 svc:/system/dumpadm:default 425 .fi 426 .in -2 427 .sp 428 429 .sp 430 .LP 431 Administrative actions on this service, such as enabling, disabling, or 432 requesting restart, can be performed using \fBsvcadm\fR(1M). The service's 433 status can be queried using the \fBsvcs\fR(1) command. 434 .SS "Dump Device Selection" 435 .sp 436 .LP 437 When the special \fBswap\fR token is specified as the argument to \fBdumpadm\fR 438 \fB-d\fR the utility will attempt to configure the most appropriate swap device 439 as the dump device. \fBdumpadm\fR configures the largest swap block device as 440 the dump device; if no block devices are available for swap, the largest swap 441 entry is configured as the dump device. If no swap entries are present, or none 442 can be configured as the dump device, a warning message will be displayed. 443 While local and remote swap files can be configured as the dump device, this is 444 not recommended. 445 .SS "Dump Device/Swap Device Interaction (UFS File Systems Only)" 446 .sp 447 .LP 448 In the event that the dump device is also a swap device, and the swap device is 449 deleted by the administrator using the \fBswap\fR \fB-d\fR command, the 450 \fBswap\fR command will automatically invoke \fBdumpadm\fR \fB-d\fR \fBswap\fR 451 in order to attempt to configure another appropriate swap device as the dump 452 device. If no swap devices remain or none can be configured as the dump device, 453 the crash dump will be disabled and a warning message will be displayed. 454 Similarly, if the crash dump is disabled and the administrator adds a new swap 455 device using the \fBswap\fR \fB-a\fR command, \fBdumpadm\fR \fB-d\fR \fBswap\fR 456 will be invoked to re-enable the crash dump using the new swap device. 457 .sp 458 .LP 459 Once \fBdumpadm\fR \fB-d\fR \fBswap\fR has been issued, the new dump device is 460 stored in the configuration file for subsequent reboots. If a larger or more 461 appropriate swap device is added by the administrator, the dump device is not 462 changed; the administrator must re-execute \fBdumpadm\fR \fB-d\fR \fBswap\fR to 463 reselect the most appropriate device fom the new list of swap devices. 464 .SS "Minimum Free Space" 465 .sp 466 .LP 467 If the \fBdumpadm\fR \fB-m\fR option is used to create a \fBminfree\fR file 468 based on a percentage of the total size of the file system containing the 469 savecore directory, this value is not automatically recomputed if the file 470 system subsequently changes size. In this case, the administrator must 471 re-execute \fBdumpadm\fR \fB-m\fR to recompute the \fBminfree\fR value. If no 472 such file exists in the savecore directory, \fBsavecore\fR will default to a 473 free space threshold of one megabyte. If no free space threshold is desired, a 474 minfree file containing size 0 can be created. 475 .SS "Security Issues" 476 .sp 477 .LP 478 If, upon reboot, the specified savecore directory is not present, it will be 479 created prior to the execution of \fBsavecore\fR with permissions 0700 (read, 480 write, execute by owner only) and owner \fBroot\fR. It is recommended that 481 alternate savecore directories also be created with similar permissions, as the 482 operating system crash dump files themselves may contain secure information.