• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Solaris : How to run savecore manually while booted in single user from CDROM

by admin

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:

  1. Boot from the alternate media
  2. Mount the root filesystem
  3. Determine the dump device
  4. Save the crashdump from the dump device
  5. 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 :

Solaris 10 (x86/x64) : How to boot into single user mode from the Grub boot loader

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

Filed Under: Solaris, SVM

Some more articles you might also be interested in …

  1. A beginners guide to Service Management Facility (SMF) in Solaris
  2. Solaris 11 : How to Verify Kernel Zone Support on a Host
  3. Understanding “Holding a ZFS Snapshot” Feature
  4. How to install and configure sudo in solaris 10 (SPARC and x86/x64)
  5. Solaris : How to increase the Inodes on UFS file system with newfs command
  6. SVM : How to un-encapsulate root disk (SPARC)
  7. How to configure a vnic on top of a Vlan Tagged Interface and assign the vnic to a Solaris 11 Zone
  8. How to Kill Zombie (Defunct) Process in Solaris
  9. How to Identify ZFS Snapshot Differences using “zfs diff”
  10. The ultimate Solaris Volume Manager (SVM) interview questions

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright