原文地址:Note<wbr>452067.1<wbr><wbr>"How<wbr>to<wbr>Configure<wbr>"kdump"<wbr>on&nb</wbr></wbr></wbr></wbr></wbr></wbr></wbr>
作者:Hello顾问
In this Document
<wbr> Goal<br><wbr> Solution<br><wbr><wbr><wbr><wbr> How to Configure Kdump<br><wbr> References<br><br> Applies to:<br> Linux OS - Version: Oracle Linux 5.0 to Oracle Linux 5.6 - Release: OL5 to OL5U6<br> Linux x86<br> Linux x86-64<br> Oracle Linux 5<br> Goal<br> Kdump is the kernel crash dumping mechanism for Oracle Linux 5 - it provides a memory dump (vmcore) when the kernel experiences a critical condition. This document provides step-by-step instructions on how to configure kdump on Oracle Linux.<br> Solution<br> How to Configure Kdump<br> 1. Install the kexec-tools package if not already installed<br><br><wbr><wbr><wbr> Kexec is a fastboot mechanism which allows booting a Linux kernel from the context of already running kernel without going through BIOS. Kdump uses kexec to boot into a second kernel whenever the system crashes.<br><br> #<wbr> up2date --nox -u kexec-tools<br> Fetching Obsoletes list for channel: el5_i386_latest...<br> ########################################<br> Fetching rpm headers...<br> ########################################<br> Name<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> Version<wbr><wbr><wbr><wbr><wbr><wbr><wbr> Rel<br> ----------------------------------------------------------<br> kexec-tools<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> 1.101<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> 194.4.el5.0.1<wbr><wbr><wbr><wbr> i386<br> Testing package set / solving RPM inter-dependencies...<br> ########################################<br> kexec-tools-1.101-194.4.el5 ########################## Done.<br> Preparing<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> ########################################### [100%]<br> Installing...<br><wbr><wbr> 1:kexec-tools<wbr><wbr><wbr><wbr> ########################################### [100%]<br> #<br><br> 2. Check the file /boot/config-`uname -r`<br><br> The values specified should denote that kexec is enabled and this kernel can be used as a crash kernel:<br> CONFIG_KEXEC=y<br> CONFIG_CRASH_DUMP=y<br> ...<br><br> 3. Modify the system kernel to reserve space for the crash kernel<br><br><wbr><wbr><wbr> Edit the /etc/grub.conf file and add "crashkernel=128M@16M" to the kernel line to reserve 128MB of memory, starting at physical address 0x01000000 (16MB)<br><br> # vi /etc/grub.conf<br><wbr>...<br> title Red Hat Enterprise Linux Server (2.6.18-8.el5)<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> root (hd0,0)<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> initrd /initrd-2.6.18-8.el5.img<br><wbr>...<br><br> 4. Specify where the vmcore should be created<br><br><wbr><wbr><wbr> Different types of dump target locations can be specified in the /etc/kdump.conf file<br><wbr><wbr><wbr> Following is a sample entry that uses NFS as the location for the dump target. For example, below will mount the filesystem and copy the vmcore file to the NFS server<br><br><wbr><wbr><wbr> net my.server.com:/export/tmp<br><br><wbr><wbr><wbr> For more options, please check the /etc/kdump.conf.<br><br> 5. Update kdump configuration file - /etc/sysconfig/kdump<br><br><wbr><wbr><wbr> This file defines the dump-capture kernel specification, including its name/location, and command line for the kernel if it is to be different from the currently running kernel.<br><br> # cat /etc/sysconfig/kdump<br> KDUMP_KERNELVER=""<br> KDUMP_COMMANDLINE=""<br> KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1"<br> KEXEC_ARGS=" --args-linux"<br> KDUMP_BOOTDIR="/boot"<br> KDUMP_IMG="vmlinuz"<br><br><br><wbr><wbr><wbr> KDUMP_COMMANDLINE modify the default crash kernel command line from /proc/cmdline<br><wbr><wbr><wbr> KDUMP_COMMANDLINE_APPEND adds irqpoll and maxcpus=1 to the command line for the crash kernel<br><wbr><wbr><wbr> KEXEC_ARGS adds --args-linux to the kexec command line<br><wbr><wbr><wbr> KDUMP_BOOTDIR is set to /boot<br><wbr><wbr><wbr> KDUMP_IMG specifies the crash kernel image name, defaulting to /boot/vmlinuz with the current kernel version appended<br><br> 6. Enable the kdump service:<br> #<wbr> chkconfig kdump on<br> #<br><br> Note: it cannot be started as the new kernel parameter is not yet in effect.<br><br> 7. Reboot the system for kdump configuration to take effect. Verify that kdump is active:<br> # cat /proc/cmdline<br> ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M<br><br> # /etc/init.d/kdump<wbr> status<br> Kdump is operational<br><br> # /sbin/chkconfig --list |grep kdump<br> kdump<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> 0:off<wbr><wbr> 1:off<wbr><wbr> 2:on<wbr><wbr><wbr> 3:on<wbr><wbr><wbr> 4:on<wbr><wbr><wbr> 5:on<wbr><wbr><wbr> 6:off<br><br><br> 8. Test kdump by crashing the system:<br> # echo c > /proc/sysrq-trigger<br><br> This causes the kernel to panic, followed by the system restarting into the kdump kernel. When the boot process gets to the point where it starts the kdump service, the vmcore file should be copied to disk to the location specified in the /etc/kdump.conf file.</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr> Goal<br><wbr> Solution<br><wbr><wbr><wbr><wbr> How to Configure Kdump<br><wbr> References<br><br> Applies to:<br> Linux OS - Version: Oracle Linux 5.0 to Oracle Linux 5.6 - Release: OL5 to OL5U6<br> Linux x86<br> Linux x86-64<br> Oracle Linux 5<br> Goal<br> Kdump is the kernel crash dumping mechanism for Oracle Linux 5 - it provides a memory dump (vmcore) when the kernel experiences a critical condition. This document provides step-by-step instructions on how to configure kdump on Oracle Linux.<br> Solution<br> How to Configure Kdump<br> 1. Install the kexec-tools package if not already installed<br><br><wbr><wbr><wbr> Kexec is a fastboot mechanism which allows booting a Linux kernel from the context of already running kernel without going through BIOS. Kdump uses kexec to boot into a second kernel whenever the system crashes.<br><br> #<wbr> up2date --nox -u kexec-tools<br> Fetching Obsoletes list for channel: el5_i386_latest...<br> ########################################<br> Fetching rpm headers...<br> ########################################<br> Name<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> Version<wbr><wbr><wbr><wbr><wbr><wbr><wbr> Rel<br> ----------------------------------------------------------<br> kexec-tools<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> 1.101<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> 194.4.el5.0.1<wbr><wbr><wbr><wbr> i386<br> Testing package set / solving RPM inter-dependencies...<br> ########################################<br> kexec-tools-1.101-194.4.el5 ########################## Done.<br> Preparing<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> ########################################### [100%]<br> Installing...<br><wbr><wbr> 1:kexec-tools<wbr><wbr><wbr><wbr> ########################################### [100%]<br> #<br><br> 2. Check the file /boot/config-`uname -r`<br><br> The values specified should denote that kexec is enabled and this kernel can be used as a crash kernel:<br> CONFIG_KEXEC=y<br> CONFIG_CRASH_DUMP=y<br> ...<br><br> 3. Modify the system kernel to reserve space for the crash kernel<br><br><wbr><wbr><wbr> Edit the /etc/grub.conf file and add "crashkernel=128M@16M" to the kernel line to reserve 128MB of memory, starting at physical address 0x01000000 (16MB)<br><br> # vi /etc/grub.conf<br><wbr>...<br> title Red Hat Enterprise Linux Server (2.6.18-8.el5)<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> root (hd0,0)<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> kernel /vmlinuz-2.6.18-8.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> initrd /initrd-2.6.18-8.el5.img<br><wbr>...<br><br> 4. Specify where the vmcore should be created<br><br><wbr><wbr><wbr> Different types of dump target locations can be specified in the /etc/kdump.conf file<br><wbr><wbr><wbr> Following is a sample entry that uses NFS as the location for the dump target. For example, below will mount the filesystem and copy the vmcore file to the NFS server<br><br><wbr><wbr><wbr> net my.server.com:/export/tmp<br><br><wbr><wbr><wbr> For more options, please check the /etc/kdump.conf.<br><br> 5. Update kdump configuration file - /etc/sysconfig/kdump<br><br><wbr><wbr><wbr> This file defines the dump-capture kernel specification, including its name/location, and command line for the kernel if it is to be different from the currently running kernel.<br><br> # cat /etc/sysconfig/kdump<br> KDUMP_KERNELVER=""<br> KDUMP_COMMANDLINE=""<br> KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1"<br> KEXEC_ARGS=" --args-linux"<br> KDUMP_BOOTDIR="/boot"<br> KDUMP_IMG="vmlinuz"<br><br><br><wbr><wbr><wbr> KDUMP_COMMANDLINE modify the default crash kernel command line from /proc/cmdline<br><wbr><wbr><wbr> KDUMP_COMMANDLINE_APPEND adds irqpoll and maxcpus=1 to the command line for the crash kernel<br><wbr><wbr><wbr> KEXEC_ARGS adds --args-linux to the kexec command line<br><wbr><wbr><wbr> KDUMP_BOOTDIR is set to /boot<br><wbr><wbr><wbr> KDUMP_IMG specifies the crash kernel image name, defaulting to /boot/vmlinuz with the current kernel version appended<br><br> 6. Enable the kdump service:<br> #<wbr> chkconfig kdump on<br> #<br><br> Note: it cannot be started as the new kernel parameter is not yet in effect.<br><br> 7. Reboot the system for kdump configuration to take effect. Verify that kdump is active:<br> # cat /proc/cmdline<br> ro root=/dev/VolGroup00/LogVol00 rhgb quiet crashkernel=128M@16M<br><br> # /etc/init.d/kdump<wbr> status<br> Kdump is operational<br><br> # /sbin/chkconfig --list |grep kdump<br> kdump<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> 0:off<wbr><wbr> 1:off<wbr><wbr> 2:on<wbr><wbr><wbr> 3:on<wbr><wbr><wbr> 4:on<wbr><wbr><wbr> 5:on<wbr><wbr><wbr> 6:off<br><br><br> 8. Test kdump by crashing the system:<br> # echo c > /proc/sysrq-trigger<br><br> This causes the kernel to panic, followed by the system restarting into the kdump kernel. When the boot process gets to the point where it starts the kdump service, the vmcore file should be copied to disk to the location specified in the /etc/kdump.conf file.</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
本文提供了一步一步的指南,说明如何在Oracle Linux 5中配置kdump,包括安装必要的工具、检查配置文件、修改系统内核以预留崩溃内核空间、指定崩溃核心存放位置、更新kdump配置文件以及启用kdump服务。
3756

被折叠的 条评论
为什么被折叠?



