System Administration Guide: Advanced Administration

Chapter 17 Managing System Crash Information (Tasks)

This chapter describes how to manage system crash information in the Solaris Operating System.

For information on the procedures associated with managing system crash information, see Managing System Crash Information (Task Map).

Managing System Crash Information (Task Map)

The following task map identifies the procedures needed to manage system crash information.

Task 

Description 

For Instructions 

1. Display the current crash dump configuration. 

Display the current crash dump configuration by using the dumpadm command.

How to Display the Current Crash Dump Configuration

2. Modify the crash dump configuration. 

Use the dumpadm command to specify the type of data to dump, whether or not the system will use a dedicated dump device, the directory for saving crash dump files, and the amount of space that must remain available after crash dump files are written.

How to Modify a Crash Dump Configuration

3. Examine a crash dump file. 

Use the mdb command to view crash dump files.

How to Examine a Crash Dump

4. (Optional) Recover from a full crash dump directory. 

The system crashes, but no room is available in the savecore directory, and you want to save some critical system crash dump information.

How to Recover From a Full Crash Dump Directory (Optional)

5. (Optional) Disable or enable the saving of crash dump files. 

Use the dumpadm command to disable or enable the saving the crash dump files. Saving crash dump files is enabled by default.

How to Disable or Enable Saving Crash Dumps

System Crashes (Overview)

System crashes can occur due to hardware malfunctions, I/O problems, and software errors. If the system crashes, it will display an error message on the console, and then write a copy of its physical memory to the dump device. The system will then reboot automatically. When the system reboots, the savecore command is executed to retrieve the data from the dump device and write the saved crash dump to your savecore directory. The saved crash dump files provide invaluable information to your support provider to aid in diagnosing the problem.

ZFS Support for Swap Devices

If you select a ZFS root file system during an initial installation or use live upgrade to migrate from a UFS root file system to a ZFS root file system, a swap area is created on a ZFS volume in the ZFS root pool. The swap area size is based on 1/4 to 1/2 of physical memory.

For example:


# swap -l
swapfile                  dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap 253,3        16  8257520  8257520

A ZFS volume is also created for the dump device. Currently, the swap area and the dump device must reside on separate ZFS volumes.

If you need to modify your ZFS swap area after installation, then use the swap command as in previous Solaris releases. For more information, see Chapter 21, Configuring Additional Swap Space (Tasks), in System Administration Guide: Devices and File Systems.

For information about managing dump devices, see Managing System Crash Dump Information.

x86: System Crashes in the GRUB Boot Environment

If a system crash occurs on an x86 based system in the GRUB boot environment, it is possible that the SMF service that manages the GRUB boot archive, svc:/system/boot-archive:default, might fail on the next system reboot. To troubleshoot this type of problem, see x86: What to Do if the SMF Boot Archive Service Fails During a System Reboot. For more information on GRUB based booting, see Booting an x86 Based System by Using GRUB (Task Map) in System Administration Guide: Basic Administration.

System Crash Dump Files

The savecore command runs automatically after a system crash to retrieve the crash dump information from the dump device and writes a pair of files called unix.X and vmcore.X, where X identifies the dump sequence number. Together, these files represent the saved system crash dump information.

Crash dump files are sometimes confused with core files, which are images of user applications that are written when the application terminates abnormally.

Crash dump files are saved in a predetermined directory, which by default, is /var/crash/hostname. In previous Solaris releases, crash dump files were overwritten when a system rebooted, unless you manually enabled the system to save the images of physical memory in a crash dump file. Now, the saving of crash dump files is enabled by default.

System crash information is managed with the dumpadm command. For more information, see The dumpadm Command.

Saving Crash Dumps

You can examine the control structures, active tables, memory images of a live or crashed system kernel, and other information about the operation of the kernel by using the mdb utility. Using mdb to its full potential requires a detailed knowledge of the kernel, and is beyond the scope of this manual. For information on using this utility, see the mdb(1) man page.

Additionally, crash dumps saved by savecore can be useful to send to a customer service representative for analysis of why the system is crashing.

The dumpadm Command

Use the dumpadm command to manage system crash dump information in the Solaris Operating System.

The following table describes dumpadm's configuration parameters.

Dump Parameter 

Description 

dump device 

The device that stores dump data temporarily as the system crashes. When the dump device is not the swap area, savecore runs in the background, which speeds up the boot process.

savecore directory 

The directory that stores system crash dump files. 

dump content 

Type of memory data to dump.  

minimum free space 

Minimum amount of free space required in the savecore directory after saving crash dump files. If no minimum free space has been configured, the default is one Mbyte.

For more information, see dumpadm(1M).

Dump configuration parameters are managed by the dumpadm command.

How the dumpadm Command Works

During system startup, the dumpadm command is invoked by the svc:/system/dumpadm:default service to configure crash dumps parameters.

Specifically, dumpadm initializes the dump device and the dump content through the /dev/dump interface.

After the dump configuration is complete, the savecore script looks for the location of the crash dump file directory. Then, savecore is invoked to check for crash dumps and check the content of the minfree file in the crash dump directory.

Dump Devices and Volume Managers

Do not configure a dedicated dump device that is under the control of volume management product such as Solaris Volume Manager for accessibility and performance reasons. You can keep your swap areas under the control of Solaris Volume Manager and this is a recommend practice, but keep your dump device separate.

Managing System Crash Dump Information

Keep the following key points in mind when you are working with system crash information:

ProcedureHow to Display the Current Crash Dump Configuration

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Display the current crash dump configuration.


    # dumpadm
    Dump content: kernel pages
    Dump device: /dev/dsk/c0t3d0s1 (swap)
    Savecore directory: /var/crash/venus
    Savecore enabled: yes

    The preceding example output means:

    • The dump content is kernel memory pages.

    • Kernel memory will be dumped on a swap device, /dev/dsk/c0t3d0s1. You can identify all your swap areas with the swap -l command.

    • System crash dump files will be written in the /var/crash/venus directory.

    • Saving crash dump files is enabled.

ProcedureHow to Modify a Crash Dump Configuration

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Identify the current crash dump configuration.


    # dumpadm
          Dump content: kernel pages
           Dump device: /dev/dsk/c0t3d0s1 (swap)
    Savecore directory: /var/crash/pluto
      Savecore enabled: yes

    This output identifies the default dump configuration for a system running the Solaris 10 release.

  3. Modify the crash dump configuration.


    # dumpadm -c content -d dump-device -m nnnk | nnnm | nnn% -n -s savecore-dir
    
    -c content

    Specifies the type of data to dump. Use kernel to dump of all kernel memory, all to dump all of memory, or curproc, to dump kernel memory and the memory pages of the process whose thread was executing when the crash occurred. The default dump content is kernel memory.

    -d dump-device

    Specifies the device that stores dump data temporarily as the system crashes. The primary swap device is the default dump device.

    -m nnnk | nnnm | nnn%

    Specifies the minimum free disk space for saving crash dump files by creating a minfree file in the current savecore directory. This parameter can be specified in Kbytes (nnnk), Mbytes (nnnm) or file system size percentage (nnn%). The savecore command consults this file prior to writing the crash dump files. If writing the crash dump files, based on their size, would decrease the amount of free space below the minfree threshold, the dump files are not written and an error message is logged. For information on recovering from this scenario, see How to Recover From a Full Crash Dump Directory (Optional).

    -n

    Specifies that savecore should not be run when the system reboots. This dump configuration is not recommended. If system crash information is written to the swap device, and savecore is not enabled, the crash dump information is overwritten when the system begins to swap.

    -s

    Specifies an alternate directory for storing crash dump files. The default directory is /var/crash/hostname where hostname is the output of the uname -n command.


Example 17–1 Modifying a Crash Dump Configuration

In this example, all of memory is dumped to the dedicated dump device, /dev/dsk/c0t1d0s1, and the minimum free space that must be available after the crash dump files are saved is 10% of the file system space.


# dumpadm
      Dump content: kernel pages
       Dump device: /dev/dsk/c0t3d0s1 (swap)
Savecore directory: /var/crash/pluto
  Savecore enabled: yes
 # dumpadm -c all -d /dev/dsk/c0t1d0s1 -m 10%
      Dump content: all pages
       Dump device: /dev/dsk/c0t1d0s1 (dedicated)
Savecore directory: /var/crash/pluto (minfree = 77071KB)
  Savecore enabled: yes

ProcedureHow to Examine a Crash Dump

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Examine a crash dump by using the mdb utility.


    # /usr/bin/mdb [-k] crashdump-file
    
    -k

    Specifies kernel debugging mode by assuming the file is an operating system crash dump file.

    crashdump-file

    Specifies the operating system crash dump file.

  3. Display crash status information.


    # /usr/bin/mdb file-name
    > ::status
       .
       .
       .
    > ::system
       .
       .
       .

Example 17–2 Examining a Crash Dump

The following example shows sample output from the mdb utility, which includes system information and identifies the tunables that are set in this system's /etc/system file.


# /usr/bin/mdb -k unix.0 
Loading modules: [ unix krtld genunix ip nfs ipc ptm ]
> ::status
debugging crash dump /dev/mem (64-bit) from ozlo
operating system: 5.10 Generic (sun4u)
> ::system
set ufs_ninode=0x9c40 [0t40000]
set ncsize=0x4e20 [0t20000]
set pt_cnt=0x400 [0t1024]

ProcedureHow to Recover From a Full Crash Dump Directory (Optional)

In this scenario, the system crashes but no room is left in the savecore directory, and you want to save some critical system crash dump information.

  1. Log in as superuser or assume an equivalent role after the system reboots.

  2. Clear out the savecore directory, usually /var/crash/hostname, by removing existing crash dump files that have already been sent to your service provider. Or, run the savecore command and specify an alternate directory that has sufficient disk space. See the next step.

  3. Manually run the savecore command and if necessary, specify an alternate savecore directory.


    # savecore [ directory ]

ProcedureHow to Disable or Enable Saving Crash Dumps

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Disable or enable the saving of crash dumps on your system.


    # dumpadm -n | -y
    

Example 17–3 Disabling the Saving of Crash Dumps

This example illustrates how to disable the saving of crash dumps on your system.


# dumpadm -n
      Dump content: all pages
       Dump device: /dev/dsk/c0t1d0s1 (dedicated)
Savecore directory: /var/crash/pluto (minfree = 77071KB)
  Savecore enabled: no


Example 17–4 Enabling the Saving of Crash Dumps

This example illustrates how to enable the saving of crash dump on your system.


# dumpadm -y
      Dump content: all pages
       Dump device: /dev/dsk/c0t1d0s1 (dedicated)
Savecore directory: /var/crash/pluto (minfree = 77071KB)
  Savecore enabled: yes