Enabling a system to save crash dumps involves:
Creating a crash dump directory
Defining how much disk space to allow for a crash dump file
Editing the /etc/init.d/sysetup file to activate the saving of crash dump files
Disabling your system from saving crash dumps involves reversing these procedures.
Become superuser.
Create the /var/crash directory.
# mkdir /var/crash |
Change to the /var/crash directory.
# cd /var/crash |
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. |
Verify the directory has been created.
# ls system-name |
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 |
Be sure you have completed any required tasks identified in Table 69-1.
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. |
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.
Exit the file, saving changes.
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 |
Be sure you have completed any required tasks identified in Table 69-1.
Become superuser.
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.
Exit the file, saving the changes.
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 '' |
Become superuser.
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. |
Display crash status information.
# /usr/sbin/crash dumpfile = /dev/mem, namelist = /dev/ksyms, outfile = stdout > status . . . > size buf proc queue . . . |
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 |
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 '' |
Save the changes.
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. |