System Administration Guide

Enabling and Disabling Crash Dumps

Enabling a system to save crash dumps involves:

Disabling your system from saving crash dumps involves reversing these procedures.

How to Create a Crash Dump Directory

  1. Become superuser.

  2. Create the /var/crash directory.


    # mkdir /var/crash
    
  3. Change to the /var/crash directory.


    # cd /var/crash
    
  4. Create a directory with the name of the system.


    # mkdir system-name
    

    system-name

    The system for which you want to save crash dump files. 

  5. Verify the directory has been created.


    # ls system-name
    

Example--Creating a Directory to Save Crash Dump Files

The following example shows how to create a directory to save crash dump files for the system saturn.


# mkdir /var/crash
# cd /var/crash
# mkdir saturn
# ls
 saturn

How to Reserve Space for Crash Dump Files

  1. Be sure you have completed any required tasks identified in Table 69-1.

  2. Become superuser.

  3. Change to the /var/crash/system-name directory.


    # cd /var/crash/system-name
    

    system-name

    The system for which you want to save crash dump files. 

  4. Using the editor of your choice, create a file named minfree that contains a number specifying the minimum available free space (in kilobytes) that must remain available for crash dumps.

  5. Exit the file, saving changes.

Example--Reserving Space for Crash Dump Files

The following example shows the contents of a minfree file that reserves 500 Kbytes of available free space to contain crash dump files for the system saturn.


$ more /var/crash/saturn/minfree
500

How to Enable Crash Dump Files

  1. Be sure you have completed any required tasks identified in Table 69-1.

  2. Become superuser.

  3. Using the editor of your choice, edit the /etc/init.d/sysetup file, activating the lines that enable the crash dumps by deleting the comment marks (#) from the beginning of those lines.

  4. Exit the file, saving the changes.

Example--Enabling Crash Dump Files

The following example shows the appropriate section of the /etc/init.d/sysetup file that has been edited to enable crash dumps.


##
## Default is to not do a savecore
##
If [ ! -d /var/crash/`uname -n` ]
then mkdir -m 0700 -p /var/crash/`uname -n`
fi
     echo 'checking for crash dump...\c '
savecore /var/crash/`uname -n`
     echo ''

How to Examine a Crash Dump

  1. Become superuser.

  2. Examine a crash dumps by using the crash utility.


    # /usr/sbin/crash [-d crashdump-file] [-n name-list] [-w output-file]

    -d crashdump-file

    Specifies a file to contain the system memory image. The default crash dump file is /dev/mem.

    -n name-list

    Specifies a text file to contain symbol table information if you want to examine symbolic access to the system memory image. The default file name is /dev/ksyms.

    -w output-file

    Specifies a file to contain output from a crash session. The default is standard output. 

  3. Display crash status information.


    # /usr/sbin/crash
    dumpfile = /dev/mem, namelist = /dev/ksyms, outfile = stdout
    > status
       .
       .
       .
    > size buf proc queue
       .
       .
       .

Example--Examining a Crash Dump

The following example shows sample output from the crash utility. Information about status, and about the buffer, process, and queue size is displayed.


# /usr/sbin/crash
dumpfile = /dev/mem, namelist = /dev/ksyms, outfile = stdout
> status
system name:    SunOS
release:        5.6
node name:      saturn
version:        Generic
machine name:   sun4m
time of crash:  Fri Jan 10 14:14:39 1997
age of system:  60 day, 5 hr., 24 min.
panicstr:
panic registers:
        eip: 0     esp: 0
> size buf proc queue
120
1552
88
 

How to Disable Crash Dump Files

  1. Become superuser.

  2. Edit the /etc/init.d/sysetup file, inserting a comment mark (#) at the beginning of each of the lines shown below.


    #if [ ! -d /var/crash/`uname -n` ]
    #then mkdir -p /var/crash/`uname -n`
    #fi
    #                echo `checking for crash dump...\c `
    #savecore /var/crash/`uname -n`
    #                echo ''
  3. Save the changes.

  4. Remove the file set up for crash dumps from the /var/crash directory.


    # rm -rf /var/crash/system-name
    

    system-name

    Name of the system which will no longer save crash dump files.