-1) Download the upstream kexec-tools userspace package from
- http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz.
-
- Apply the latest consolidated kdump patch on top of kexec-tools-1.101
- from http://lse.sourceforge.net/kdump/. This arrangment has been made
- till all the userspace patches supporting kdump are integrated with
- upstream kexec-tools userspace.
-
-2) Download and build the appropriate (2.6.13-rc1 onwards) vanilla kernels.
- Two kernels need to be built in order to get this feature working.
- Following are the steps to properly configure the two kernels specific
- to kexec and kdump features:
-
- A) First kernel or regular kernel:
- ----------------------------------
- a) Enable "kexec system call" feature (in Processor type and features).
- CONFIG_KEXEC=y
- b) Enable "sysfs file system support" (in Pseudo filesystems).
- CONFIG_SYSFS=y
- c) make
- d) Boot into first kernel with the command line parameter "crashkernel=Y@X".
- Use appropriate values for X and Y. Y denotes how much memory to reserve
- for the second kernel, and X denotes at what physical address the
- reserved memory section starts. For example: "crashkernel=64M@16M".
-
-
- B) Second kernel or dump capture kernel:
- ---------------------------------------
- a) For i386 architecture enable Highmem support
- CONFIG_HIGHMEM=y
- b) Enable "kernel crash dumps" feature (under "Processor type and features")
- CONFIG_CRASH_DUMP=y
- c) Make sure a suitable value for "Physical address where the kernel is
- loaded" (under "Processor type and features"). By default this value
- is 0x1000000 (16MB) and it should be same as X (See option d above),
- e.g., 16 MB or 0x1000000.
- CONFIG_PHYSICAL_START=0x1000000
- d) Enable "/proc/vmcore support" (Optional, under "Pseudo filesystems").
- CONFIG_PROC_VMCORE=y
-
-3) After booting to regular kernel or first kernel, load the second kernel
- using the following command:
-
- kexec -p <second-kernel> --args-linux --elf32-core-headers
- --append="root=<root-dev> init 1 irqpoll maxcpus=1"
-
- Notes:
- ======
- i) <second-kernel> has to be a vmlinux image ie uncompressed elf image.
- bzImage will not work, as of now.
- ii) --args-linux has to be speicfied as if kexec it loading an elf image,
- it needs to know that the arguments supplied are of linux type.
- iii) By default ELF headers are stored in ELF64 format to support systems
- with more than 4GB memory. Option --elf32-core-headers forces generation
- of ELF32 headers. The reason for this option being, as of now gdb can
- not open vmcore file with ELF64 headers on a 32 bit systems. So ELF32
- headers can be used if one has non-PAE systems and hence memory less
- than 4GB.
- iv) Specify "irqpoll" as command line parameter. This reduces driver
- initialization failures in second kernel due to shared interrupts.
- v) <root-dev> needs to be specified in a format corresponding to the root
- device name in the output of mount command.
- vi) If you have built the drivers required to mount root file system as
- modules in <second-kernel>, then, specify
- --initrd=<initrd-for-second-kernel>.
- vii) Specify maxcpus=1 as, if during first kernel run, if panic happens on
- non-boot cpus, second kernel doesn't seem to be boot up all the cpus.
- The other option is to always built the second kernel without SMP
- support ie CONFIG_SMP=n
-
-4) After successfully loading the second kernel as above, if a panic occurs
- system reboots into the second kernel. A module can be written to force
- the panic or "ALT-SysRq-c" can be used initiate a crash dump for testing
- purposes.
-
-5) Once the second kernel has booted, write out the dump file using
+ CONFIG_SMP=n
+
+ (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line
+ when loading the dump-capture kernel, see section "Load the Dump-capture
+ Kernel".)
+
+2) Use a suitable value for "Physical address where the kernel is
+ loaded" (under "Processor type and features"). This only appears when
+ "kernel crash dumps" is enabled. By default this value is 0x1000000
+ (16MB). It should be the same as X in the "crashkernel=Y@X" boot
+ parameter.
+
+ For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000".
+
+3) Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.
+
+Dump-capture kernel config options (Arch Dependent, ppc64)
+----------------------------------------------------------
+
+- Make and install the kernel and its modules. DO NOT add this kernel
+ to the boot loader configuration files.
+
+Dump-capture kernel config options (Arch Dependent, ia64)
+----------------------------------------------------------
+
+- No specific options are required to create a dump-capture kernel
+ for ia64, other than those specified in the arch idependent section
+ above. This means that it is possible to use the system kernel
+ as a dump-capture kernel if desired.
+
+ The crashkernel region can be automatically placed by the system
+ kernel at run time. This is done by specifying the base address as 0,
+ or omitting it all together.
+
+ crashkernel=256M@0
+ or
+ crashkernel=256M
+
+ If the start address is specified, note that the start address of the
+ kernel will be aligned to 64Mb, so if the start address is not then
+ any space below the alignment point will be wasted.
+
+
+Boot into System Kernel
+=======================
+
+1) Make and install the kernel and its modules. Update the boot loader
+ (such as grub, yaboot, or lilo) configuration files as necessary.
+
+2) Boot the system kernel with the boot parameter "crashkernel=Y@X",
+ where Y specifies how much memory to reserve for the dump-capture kernel
+ and X specifies the beginning of this reserved memory. For example,
+ "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory
+ starting at physical address 0x01000000 (16MB) for the dump-capture kernel.
+
+ On x86 and x86_64, use "crashkernel=64M@16M".
+
+ On ppc64, use "crashkernel=128M@32M".
+
+ On ia64, 256M@256M is a generous value that typically works.
+ The region may be automatically placed on ia64, see the
+ dump-capture kernel config option notes above.
+
+Load the Dump-capture Kernel
+============================
+
+After booting to the system kernel, dump-capture kernel needs to be
+loaded.
+
+Based on the architecture and type of image (relocatable or not), one
+can choose to load the uncompressed vmlinux or compressed bzImage/vmlinuz
+of dump-capture kernel. Following is the summary.
+
+For i386:
+ - Use vmlinux if kernel is not relocatable.
+ - Use bzImage/vmlinuz if kernel is relocatable.
+For x86_64:
+ - Use vmlinux
+For ppc64:
+ - Use vmlinux
+For ia64:
+ - Use vmlinux or vmlinuz.gz
+
+
+If you are using a uncompressed vmlinux image then use following command
+to load dump-capture kernel.
+
+ kexec -p <dump-capture-kernel-vmlinux-image> \
+ --initrd=<initrd-for-dump-capture-kernel> --args-linux \
+ --append="root=<root-dev> <arch-specific-options>"
+
+If you are using a compressed bzImage/vmlinuz, then use following command
+to load dump-capture kernel.
+
+ kexec -p <dump-capture-kernel-bzImage> \
+ --initrd=<initrd-for-dump-capture-kernel> \
+ --append="root=<root-dev> <arch-specific-options>"
+
+Please note, that --args-linux does not need to be specified for ia64.
+It is planned to make this a no-op on that architecture, but for now
+it should be omitted
+
+Following are the arch specific command line options to be used while
+loading dump-capture kernel.
+
+For i386, x86_64 and ia64:
+ "init 1 irqpoll maxcpus=1"
+
+For ppc64:
+ "init 1 maxcpus=1 noirqdistrib"
+
+
+Notes on loading the dump-capture kernel:
+
+* By default, the ELF headers are stored in ELF64 format to support
+ systems with more than 4GB memory. The --elf32-core-headers option can
+ be used to force the generation of ELF32 headers. This is necessary
+ because GDB currently cannot open vmcore files with ELF64 headers on
+ 32-bit systems. ELF32 headers can be used on non-PAE systems (that is,
+ less than 4GB of memory).
+
+* The "irqpoll" boot parameter reduces driver initialization failures
+ due to shared interrupts in the dump-capture kernel.
+
+* You must specify <root-dev> in the format corresponding to the root
+ device name in the output of mount command.
+
+* "init 1" boots the dump-capture kernel into single-user mode without
+ networking. If you want networking, use "init 3."
+
+* We generally don' have to bring up a SMP kernel just to capture the
+ dump. Hence generally it is useful either to build a UP dump-capture
+ kernel or specify maxcpus=1 option while loading dump-capture kernel.
+
+Kernel Panic
+============
+
+After successfully loading the dump-capture kernel as previously
+described, the system will reboot into the dump-capture kernel if a
+system crash is triggered. Trigger points are located in panic(),
+die(), die_nmi() and in the sysrq handler (ALT-SysRq-c).
+
+The following conditions will execute a crash trigger point:
+
+If a hard lockup is detected and "NMI watchdog" is configured, the system
+will boot into the dump-capture kernel ( die_nmi() ).
+
+If die() is called, and it happens to be a thread with pid 0 or 1, or die()
+is called inside interrupt context or die() is called and panic_on_oops is set,
+the system will boot into the dump-capture kernel.
+
+On powererpc systems when a soft-reset is generated, die() is called by all cpus and the system will boot into the dump-capture kernel.
+
+For testing purposes, you can trigger a crash by using "ALT-SysRq-c",
+"echo c > /proc/sysrq-trigger or write a module to force the panic.
+
+Write Out the Dump File
+=======================
+
+After the dump-capture kernel is booted, write out the dump file with
+the following command: