For various reasons it may be necessary to gather a crash dump while booted from alternate media, for example if the system is not booting properly from the normal boot disk. This document outlines the steps required to accomplish this.
In general, the steps required are:
- Boot from the alternate media
- Mount the root filesystem
- Determine the dump device
- Save the crashdump from the dump device
- Unmount the root (and other) filesystems
1. Boot from the Alternate Media
To boot from CDROM or DVD media use (in case of SPARC machine):
ok> boot cdrom -s
In case of a x86/x64 hardware use the below guide to boot from DVD :
2. Mount the root filesystem
1. Root Filesystem on UFS on a simple slice
Assuming that the root filesystem resides on c0t0d0s0 when booted from the alternate media, and that we are not using Solaris Volume Manager. Ensure that the device has consistent metadata, then mount the root filesystem.
# fsck -y /dev/rdsk/c0t0d0s0 # mount /dev/dsk/c0t0d0s0 /a
Determine if /var or /usr are separate mount points, and if so mount them.
# egrep '/usr|/var' /a/etc/vfstab /dev/dsk/c0t0d0s3 /dev/rdsk/c0t0d0s3 /var ufs 1 yes logging # mount /dev/dsk/c0t0d0s3 /a/var
2. Root filesystem is a zpool and the dump device is a zvol
Import the root zpool without mounting any filesystems
# zpool import -fN rpool
Find the root filesystem we are interested in and mount it as /a.
# zfs list NAME USED AVAIL REFER MOUNTPOINT ... rpool/ROOT/Solaris10-2 20.9G 79.8G 13.4G / ...
# zfs mount rpool/ROOT/Solaris10-2 /a
If the zfs list shows /var and/or /usr these should also be similarly mounted on /a/var and /a/usr.
3. Determine the dump device
Given that we have our root filesystem mounted on /a, have a look at the dump configuration:
# cat /a/etc/dumpadm.conf ... DUMPADM_DEVICE=/dev/zvol/dsk/rpool/dump DUMPADM_SAVDIR=/var/crash/hostname DUMPADM_CONTENT=kernel DUMPADM_ENABLE=no DUMPADM_CSAVE=on
Take note of DUMPADM_DEVICE (where we will read the crashdump from) and DUMPADM_SAVEDIR (where we will save the crashdump to).
4. Save the crashdump
Assuming that you want to write the crashdump into the default dump directory (DUMPADM_SAVDIR above), run :
# savecore -dv -f DUMPADM_DEVICE DUMPADM_SAVDIR
substituting the values from step 3 for DUMPADM_DEVICE and DUMPADM_SAVDIR. Verify that you have new crashdump in the DUMPADM_SAVEDIR directory.
5. Unmount the root (and other) filesystems
If you have mounted any other filesystem they will need to be unmounted before unmounting /a. For example if you had a /var mounted:
# umount /a/var # umount /a