注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

hty

 
 
 

日志

 
 

Suse: Configure kernel core dump capture  

2009-03-09 10:21:32|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Configure kernel core dump capture

This document (3374462) is provided subject to the disclaimer at the end of this document.

Environment

Novell SUSE Linux Enterprise Server 10
Novell SUSE Linux Enterprise Desktop 10
x86 (Intel 32-bit), x86_64 (AMD 64-bit / Intel EM64T), PPC64 (IBM POWER, 64-bit) or IA-64 (Itanium) architecture

Situation

The kernel is crashing or otherwise misbehaving and a kernel core dump needs to be captured for analysis.

Resolution

Prerequisites

Kdump stores kernel core dumps under /var.
The partition that /var is on must have enough available disk space for the vmcore file, which will be approximately the size of the system's physical memory. By default, the system will attempt to keep 5 vmcore files.

Check the taint status of the kernel (recommended)

Whenever possible, kernel crashes should be reproduced using untainted kernels. Refer to TID 3582750, Tainted Kernel, for details on kernel tainting, the impact of tainting on supportability and for recommendations on how to avoid tainting the kernel.

Set up magic SysRq (recommended)

For kernel problems other than a kernel oops or panic, a kernel core dump is not triggered automatically. If the system still responds to keyboard input to some degree, a kernel core dump can be triggered manually through a "magic SysRq" keyboard combination (typically: hold down three keys simultaneously: the left Alt key, the Print Screen / SysRq key and a letter key indicating the command - 's' for sync, 'c' for core dump), if this feature has been enabled.


For general documentation of the "magic SysRq" feature, please refer to the Documentation/sysrq.txt file in the Linux kernel source.

To enable the magic SysRq feature permanently, edit /etc/sysconfig/sysctl, change the ENABLE_SYSRQ line to ENABLE_SYSRQ="yes". This change becomes active after a reboot. To enable the feature for the running kernel, run

Set up serial console (recommended)

For some kernel problems, a kernel core dump is not triggered and the system does not respond to the keyboard anymore. For those situations, it may still be possible to trigger a kernel core dump through magic SysRq sequences from a serial console.

Please refer to TID 3456486, Configuring a Remote Serial Console for SLES, for the procedure.

Configure the system for capturing kernel core dumps
  1. Install the packages kernel-kdump and kexec-tools.

    The kernel-kdump package contains a "crash" or "capture" kernel that is started when the primary kernel has crashed and which provides an environment in which the primary kernel's state can be captured. The version of the kernel-dump package needs to be identical to that of the kerenl whose state needs to be captured.

    The kexec-tools package contains the tools that make it possible to start the capture kernel from the primary kernel.

  2. Reserve memory for the capture kernel by passing appropriate parameters to the primary kernel.
    For the x86 and x86_64 architecture: crashkernel=64M@16M
    For the PPC64 architecture: crashkernel=128M@32M
    Note: for Xen installations, this parameter needs to be passed to the GRUB line for the Xen hypervisor, not the module line for the Dom0 kernel.

    This can be done as follows: Start YaST, under System, select Boot Loader. On the tab Section Management, select the default section and select Edit. Add the settings to the field labeled Optional Kernel Command Line Parameter, then select Ok and Finish to save the settings.

  3. Activate the kdump system service.

    Run
    chkconfig kdump on
    or in YaST: under System, select System Services (Runlevel), select kdump, then select Enable and Finish.

  4. Reboot the system for the settings to take effect

Test local kernel core dump capture

To test the local kernel core dump capture, follow these steps.
If magic SysRq has been configured:
  1. Magic-SysRq-S to sync (flush out pending writes)
  2. Magic-SysRq-C to trigger the kernel core dump
Alternatively, without magic SysRq:
  1. Open a shell or terminal
  2. Run sync
  3. Run echo c >/proc/sysrq-trigger
Please note that the system will not be responsive while the capture is being prepared and made as the capture kernel environment is a limited, non-interactive environment.

Once the system becomes responsive again, verify that a capture file was created as /var/log/dump/date-time
/vmcore.


Setup for network dump captures - prepare for non-interactive data transfers

The scp command (part of OpenSSH) will be used to transfer the dump over the network.

As the capture environment on the dumping system is completely non-interactive, all authorization for the data transfer needs to be set up in advance, so
the system that is to receive the dump needs to accept SSH connections from the dumping server without requiring passwords. This can be done as follows:
  • on the sending system, as therootuser, generate a keypair for SSH, unprotected by a passphrase:
    ssh-keygen -N '' -C 'passthrough key' -t dsa2
  • From the sending system, add the public key from this keypair to the list of authorized keys for therootuser on the receiving system:
    ssh root@receiving.system' cat >>/root/.ssh/authorized_keys' < /root/.ssh/id_dsa.pub
On the receiving system, as the root user, create a directory in which to receive the dump, say /dump:
install -m 700 -u root -g root -d /dump
Make sure this directory resides on a filesystem with sufficient free space.


Setup for network dump captures - sending (dumping) system

For a network dump capture, the following settings need to be configured in /etc/sysconfig/kdump on the dumping system:
KDUMP_RUNLEVEL=3
KDUMP_TRANSFER="scp /proc/vmcoreReceivingSystemNameOrIP:/dump/"

This will make kdump act in a manner similar to the older netdump mechanism: the capture environment will go up to runlevel 3 (where network connectivity is enabled) and will use the secure copy command scp to transfer the kernel core dump to a separate system.

Additional Information

Limitations

Kdump is not supported for Xen kernels prior to Service Pack 2.
On the IA-64 architecture, kdump is only supported as of Service Pack 1.

Related documentation

Configuring a IBM System z Linux server for a coredump

On IBM System z systems, a different methodology is used for capturing kernel crash dumps.
It is documented in IBM's documentation Linux on System z - Using the Dump Tools available as http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/docu/l26cdt01.pdf
(or via http://www.ibm.com/developerworks/linux/linux390/history.html
) and needs the s390-tools to package be installed.

Document

Document ID: 3374462
Creation Date: 01-10-2008
Modified Date: 07-15-2008
Novell Product: SUSE Linux Enterprise Desktop
Novell Product: SUSE Linux Enterprise Server



引文来源  Configure kernel core dump capture
  评论这张
 
阅读(901)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017