diff options
-rw-r--r-- | Documentation/kdump/kdump.txt | 224 |
1 files changed, 152 insertions, 72 deletions
diff --git a/Documentation/kdump/kdump.txt b/Documentation/kdump/kdump.txt index 99f2d4d4bf7d..5af6676a88f0 100644 --- a/Documentation/kdump/kdump.txt +++ b/Documentation/kdump/kdump.txt | |||
@@ -17,7 +17,7 @@ You can use common Linux commands, such as cp and scp, to copy the | |||
17 | memory image to a dump file on the local disk, or across the network to | 17 | memory image to a dump file on the local disk, or across the network to |
18 | a remote system. | 18 | a remote system. |
19 | 19 | ||
20 | Kdump and kexec are currently supported on the x86, x86_64, and ppc64 | 20 | Kdump and kexec are currently supported on the x86, x86_64, ppc64 and IA64 |
21 | architectures. | 21 | architectures. |
22 | 22 | ||
23 | When the system kernel boots, it reserves a small section of memory for | 23 | When the system kernel boots, it reserves a small section of memory for |
@@ -54,59 +54,64 @@ memory," in two ways: | |||
54 | Setup and Installation | 54 | Setup and Installation |
55 | ====================== | 55 | ====================== |
56 | 56 | ||
57 | Install kexec-tools and the Kdump patch | 57 | Install kexec-tools |
58 | --------------------------------------- | 58 | ------------------- |
59 | 59 | ||
60 | 1) Login as the root user. | 60 | 1) Login as the root user. |
61 | 61 | ||
62 | 2) Download the kexec-tools user-space package from the following URL: | 62 | 2) Download the kexec-tools user-space package from the following URL: |
63 | 63 | ||
64 | http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-1.101.tar.gz | 64 | http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing-20061214.tar.gz |
65 | 65 | ||
66 | 3) Unpack the tarball with the tar command, as follows: | 66 | Note: Latest kexec-tools-testing git tree is available at |
67 | |||
68 | tar xvpzf kexec-tools-1.101.tar.gz | ||
69 | |||
70 | 4) Download the latest consolidated Kdump patch from the following URL: | ||
71 | |||
72 | http://lse.sourceforge.net/kdump/ | ||
73 | 67 | ||
74 | (This location is being used until all the user-space Kdump patches | 68 | git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git |
75 | are integrated with the kexec-tools package.) | 69 | or |
70 | http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary | ||
76 | 71 | ||
77 | 5) Change to the kexec-tools-1.101 directory, as follows: | 72 | 3) Unpack the tarball with the tar command, as follows: |
78 | 73 | ||
79 | cd kexec-tools-1.101 | 74 | tar xvpzf kexec-tools-testing-20061214.tar.gz |
80 | 75 | ||
81 | 6) Apply the consolidated patch to the kexec-tools-1.101 source tree | 76 | 4) Change to the kexec-tools-1.101 directory, as follows: |
82 | with the patch command, as follows. (Modify the path to the downloaded | ||
83 | patch as necessary.) | ||
84 | 77 | ||
85 | patch -p1 < /path-to-kdump-patch/kexec-tools-1.101-kdump.patch | 78 | cd kexec-tools-testing-20061214 |
86 | 79 | ||
87 | 7) Configure the package, as follows: | 80 | 5) Configure the package, as follows: |
88 | 81 | ||
89 | ./configure | 82 | ./configure |
90 | 83 | ||
91 | 8) Compile the package, as follows: | 84 | 6) Compile the package, as follows: |
92 | 85 | ||
93 | make | 86 | make |
94 | 87 | ||
95 | 9) Install the package, as follows: | 88 | 7) Install the package, as follows: |
96 | 89 | ||
97 | make install | 90 | make install |
98 | 91 | ||
99 | 92 | ||
100 | Download and build the system and dump-capture kernels | 93 | Build the system and dump-capture kernels |
101 | ------------------------------------------------------ | 94 | ----------------------------------------- |
95 | There are two possible methods of using Kdump. | ||
96 | |||
97 | 1) Build a separate custom dump-capture kernel for capturing the | ||
98 | kernel core dump. | ||
99 | |||
100 | 2) Or use the system kernel binary itself as dump-capture kernel and there is | ||
101 | no need to build a separate dump-capture kernel. This is possible | ||
102 | only with the architecutres which support a relocatable kernel. As | ||
103 | of today i386 and ia64 architectures support relocatable kernel. | ||
104 | |||
105 | Building a relocatable kernel is advantageous from the point of view that | ||
106 | one does not have to build a second kernel for capturing the dump. But | ||
107 | at the same time one might want to build a custom dump capture kernel | ||
108 | suitable to his needs. | ||
102 | 109 | ||
103 | Download the mainline (vanilla) kernel source code (2.6.13-rc1 or newer) | 110 | Following are the configuration setting required for system and |
104 | from http://www.kernel.org. Two kernels must be built: a system kernel | 111 | dump-capture kernels for enabling kdump support. |
105 | and a dump-capture kernel. Use the following steps to configure these | ||
106 | kernels with the necessary kexec and Kdump features: | ||
107 | 112 | ||
108 | System kernel | 113 | System kernel config options |
109 | ------------- | 114 | ---------------------------- |
110 | 115 | ||
111 | 1) Enable "kexec system call" in "Processor type and features." | 116 | 1) Enable "kexec system call" in "Processor type and features." |
112 | 117 | ||
@@ -132,88 +137,160 @@ System kernel | |||
132 | analysis tools require a vmlinux with debug symbols in order to read | 137 | analysis tools require a vmlinux with debug symbols in order to read |
133 | and analyze a dump file. | 138 | and analyze a dump file. |
134 | 139 | ||
135 | 4) Make and install the kernel and its modules. Update the boot loader | 140 | Dump-capture kernel config options (Arch Independent) |
136 | (such as grub, yaboot, or lilo) configuration files as necessary. | 141 | ----------------------------------------------------- |
137 | |||
138 | 5) Boot the system kernel with the boot parameter "crashkernel=Y@X", | ||
139 | where Y specifies how much memory to reserve for the dump-capture kernel | ||
140 | and X specifies the beginning of this reserved memory. For example, | ||
141 | "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory | ||
142 | starting at physical address 0x01000000 for the dump-capture kernel. | ||
143 | |||
144 | On x86 and x86_64, use "crashkernel=64M@16M". | ||
145 | 142 | ||
146 | On ppc64, use "crashkernel=128M@32M". | 143 | 1) Enable "kernel crash dumps" support under "Processor type and |
144 | features": | ||
147 | 145 | ||
146 | CONFIG_CRASH_DUMP=y | ||
148 | 147 | ||
149 | The dump-capture kernel | 148 | 2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems". |
150 | ----------------------- | ||
151 | 149 | ||
152 | 1) Under "General setup," append "-kdump" to the current string in | 150 | CONFIG_PROC_VMCORE=y |
153 | "Local version." | 151 | (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.) |
154 | 152 | ||
155 | 2) On x86, enable high memory support under "Processor type and | 153 | Dump-capture kernel config options (Arch Dependent, i386) |
154 | -------------------------------------------------------- | ||
155 | 1) On x86, enable high memory support under "Processor type and | ||
156 | features": | 156 | features": |
157 | 157 | ||
158 | CONFIG_HIGHMEM64G=y | 158 | CONFIG_HIGHMEM64G=y |
159 | or | 159 | or |
160 | CONFIG_HIGHMEM4G | 160 | CONFIG_HIGHMEM4G |
161 | 161 | ||
162 | 3) On x86 and x86_64, disable symmetric multi-processing support | 162 | 2) On x86 and x86_64, disable symmetric multi-processing support |
163 | under "Processor type and features": | 163 | under "Processor type and features": |
164 | 164 | ||
165 | CONFIG_SMP=n | 165 | CONFIG_SMP=n |
166 | |||
166 | (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line | 167 | (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line |
167 | when loading the dump-capture kernel, see section "Load the Dump-capture | 168 | when loading the dump-capture kernel, see section "Load the Dump-capture |
168 | Kernel".) | 169 | Kernel".) |
169 | 170 | ||
170 | 4) On ppc64, disable NUMA support and enable EMBEDDED support: | 171 | 3) If one wants to build and use a relocatable kernel, |
172 | Enable "Build a relocatable kernel" support under "Processor type and | ||
173 | features" | ||
171 | 174 | ||
172 | CONFIG_NUMA=n | 175 | CONFIG_RELOCATABLE=y |
173 | CONFIG_EMBEDDED=y | ||
174 | CONFIG_EEH=N for the dump-capture kernel | ||
175 | 176 | ||
176 | 5) Enable "kernel crash dumps" support under "Processor type and | 177 | 4) Use a suitable value for "Physical address where the kernel is |
177 | features": | 178 | loaded" (under "Processor type and features"). This only appears when |
179 | "kernel crash dumps" is enabled. A suitable value depends upon | ||
180 | whether kernel is relocatable or not. | ||
181 | |||
182 | If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000 | ||
183 | This will compile the kernel for physical address 1MB, but given the fact | ||
184 | kernel is relocatable, it can be run from any physical address hence | ||
185 | kexec boot loader will load it in memory region reserved for dump-capture | ||
186 | kernel. | ||
187 | |||
188 | Otherwise it should be the start of memory region reserved for | ||
189 | second kernel using boot parameter "crashkernel=Y@X". Here X is | ||
190 | start of memory region reserved for dump-capture kernel. | ||
191 | Generally X is 16MB (0x1000000). So you can set | ||
192 | CONFIG_PHYSICAL_START=0x1000000 | ||
193 | |||
194 | 5) Make and install the kernel and its modules. DO NOT add this kernel | ||
195 | to the boot loader configuration files. | ||
178 | 196 | ||
179 | CONFIG_CRASH_DUMP=y | 197 | Dump-capture kernel config options (Arch Dependent, x86_64) |
198 | ---------------------------------------------------------- | ||
199 | 1) On x86 and x86_64, disable symmetric multi-processing support | ||
200 | under "Processor type and features": | ||
201 | |||
202 | CONFIG_SMP=n | ||
203 | |||
204 | (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line | ||
205 | when loading the dump-capture kernel, see section "Load the Dump-capture | ||
206 | Kernel".) | ||
180 | 207 | ||
181 | 6) Use a suitable value for "Physical address where the kernel is | 208 | 2) Use a suitable value for "Physical address where the kernel is |
182 | loaded" (under "Processor type and features"). This only appears when | 209 | loaded" (under "Processor type and features"). This only appears when |
183 | "kernel crash dumps" is enabled. By default this value is 0x1000000 | 210 | "kernel crash dumps" is enabled. By default this value is 0x1000000 |
184 | (16MB). It should be the same as X in the "crashkernel=Y@X" boot | 211 | (16MB). It should be the same as X in the "crashkernel=Y@X" boot |
185 | parameter discussed above. | 212 | parameter. |
186 | 213 | ||
187 | On x86 and x86_64, use "CONFIG_PHYSICAL_START=0x1000000". | 214 | For x86_64, normally "CONFIG_PHYSICAL_START=0x1000000". |
188 | 215 | ||
189 | On ppc64 the value is automatically set at 32MB when | 216 | 3) Make and install the kernel and its modules. DO NOT add this kernel |
190 | CONFIG_CRASH_DUMP is set. | 217 | to the boot loader configuration files. |
191 | |||
192 | 6) Optionally enable "/proc/vmcore support" under "Filesystems" -> | ||
193 | "Pseudo filesystems". | ||
194 | 218 | ||
195 | CONFIG_PROC_VMCORE=y | 219 | Dump-capture kernel config options (Arch Dependent, ppc64) |
196 | (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.) | 220 | ---------------------------------------------------------- |
197 | 221 | ||
198 | 7) Make and install the kernel and its modules. DO NOT add this kernel | 222 | - Make and install the kernel and its modules. DO NOT add this kernel |
199 | to the boot loader configuration files. | 223 | to the boot loader configuration files. |
200 | 224 | ||
225 | Dump-capture kernel config options (Arch Dependent, ia64) | ||
226 | ---------------------------------------------------------- | ||
227 | (To be filled) | ||
228 | |||
229 | |||
230 | Boot into System Kernel | ||
231 | ======================= | ||
232 | |||
233 | 1) Make and install the kernel and its modules. Update the boot loader | ||
234 | (such as grub, yaboot, or lilo) configuration files as necessary. | ||
235 | |||
236 | 2) Boot the system kernel with the boot parameter "crashkernel=Y@X", | ||
237 | where Y specifies how much memory to reserve for the dump-capture kernel | ||
238 | and X specifies the beginning of this reserved memory. For example, | ||
239 | "crashkernel=64M@16M" tells the system kernel to reserve 64 MB of memory | ||
240 | starting at physical address 0x01000000 (16MB) for the dump-capture kernel. | ||
241 | |||
242 | On x86 and x86_64, use "crashkernel=64M@16M". | ||
243 | |||
244 | On ppc64, use "crashkernel=128M@32M". | ||
201 | 245 | ||
202 | Load the Dump-capture Kernel | 246 | Load the Dump-capture Kernel |
203 | ============================ | 247 | ============================ |
204 | 248 | ||
205 | After booting to the system kernel, load the dump-capture kernel using | 249 | After booting to the system kernel, dump-capture kernel needs to be |
206 | the following command: | 250 | loaded. |
251 | |||
252 | Based on the architecture and type of image (relocatable or not), one | ||
253 | can choose to load the uncompressed vmlinux or compressed bzImage/vmlinuz | ||
254 | of dump-capture kernel. Following is the summary. | ||
255 | |||
256 | For i386: | ||
257 | - Use vmlinux if kernel is not relocatable. | ||
258 | - Use bzImage/vmlinuz if kernel is relocatable. | ||
259 | For x86_64: | ||
260 | - Use vmlinux | ||
261 | For ppc64: | ||
262 | - Use vmlinux | ||
263 | For ia64: | ||
264 | (To be filled) | ||
265 | |||
266 | If you are using a uncompressed vmlinux image then use following command | ||
267 | to load dump-capture kernel. | ||
207 | 268 | ||
208 | kexec -p <dump-capture-kernel> \ | 269 | kexec -p <dump-capture-kernel-vmlinux-image> \ |
209 | --initrd=<initrd-for-dump-capture-kernel> --args-linux \ | 270 | --initrd=<initrd-for-dump-capture-kernel> --args-linux \ |
210 | --append="root=<root-dev> init 1 irqpoll" | 271 | --append="root=<root-dev> <arch-specific-options>" |
211 | 272 | ||
273 | If you are using a compressed bzImage/vmlinuz, then use following command | ||
274 | to load dump-capture kernel. | ||
212 | 275 | ||
213 | Notes on loading the dump-capture kernel: | 276 | kexec -p <dump-capture-kernel-bzImage> \ |
277 | --initrd=<initrd-for-dump-capture-kernel> \ | ||
278 | --append="root=<root-dev> <arch-specific-options>" | ||
279 | |||
280 | Following are the arch specific command line options to be used while | ||
281 | loading dump-capture kernel. | ||
282 | |||
283 | For i386 and x86_64: | ||
284 | "init 1 irqpoll maxcpus=1" | ||
285 | |||
286 | For ppc64: | ||
287 | "init 1 maxcpus=1 noirqdistrib" | ||
214 | 288 | ||
215 | * <dump-capture-kernel> must be a vmlinux image (that is, an | 289 | For IA64 |
216 | uncompressed ELF image). bzImage does not work at this time. | 290 | (To be filled) |
291 | |||
292 | |||
293 | Notes on loading the dump-capture kernel: | ||
217 | 294 | ||
218 | * By default, the ELF headers are stored in ELF64 format to support | 295 | * By default, the ELF headers are stored in ELF64 format to support |
219 | systems with more than 4GB memory. The --elf32-core-headers option can | 296 | systems with more than 4GB memory. The --elf32-core-headers option can |
@@ -231,6 +308,9 @@ Notes on loading the dump-capture kernel: | |||
231 | * "init 1" boots the dump-capture kernel into single-user mode without | 308 | * "init 1" boots the dump-capture kernel into single-user mode without |
232 | networking. If you want networking, use "init 3." | 309 | networking. If you want networking, use "init 3." |
233 | 310 | ||
311 | * We generally don' have to bring up a SMP kernel just to capture the | ||
312 | dump. Hence generally it is useful either to build a UP dump-capture | ||
313 | kernel or specify maxcpus=1 option while loading dump-capture kernel. | ||
234 | 314 | ||
235 | Kernel Panic | 315 | Kernel Panic |
236 | ============ | 316 | ============ |