1kexec(8)                         User Manuals                         kexec(8)
2
3
4

NAME

6       kexec - directly boot into a new kernel
7

SYNOPSIS

9       /sbin/kexec  [-v  (--version)]  [-f  (--force)]  [-x (--no-ifdown)] [-l
10       (--load)]  [-p  (--load-panic)]  [-u  (--unload)]  [-e  (--exec)]   [-t
11       (--type)] [--mem-min=addr] [--mem-max=addr]
12
13

DESCRIPTION

15       kexec  is  a system call that enables you to load and boot into another
16       kernel from the currently running kernel.  kexec performs the  function
17       of  the  boot  loader  from  within  the kernel. The primary difference
18       between a standard system boot and a kexec boot is  that  the  hardware
19       initialization normally performed by the BIOS or firmware (depending on
20       architecture) is not performed during a kexec boot. This has the effect
21       of reducing the time required for a reboot.
22
23       Make sure you have selected CONFIG_KEXEC=y when configuring the kernel.
24       The CONFIG_KEXEC option enables the kexec system call.
25

USAGE

27       Using kexec consists of
28
29              (1) loading the kernel to be rebooted to into memory, and
30              (2) actually rebooting to the pre-loaded kernel.
31
32       To load a kernel, the syntax is as follows:
33
34              kexec   -l kernel-image   --append=command-line-options   --ini‐
35              trd=initrd-image
36
37       where kernel-image is the kernel file that you intend to reboot to.
38
39       Insert  the command-line parameters that must be passed to the new ker‐
40       nel  into  command-line-options.   Passing  the   exact   contents   of
41       /proc/cmdline  into  command-line-options  is  the safest way to ensure
42       that correct values are passed to the rebooting kernel.
43
44       The optional initrd-image is the initrd image to be used during boot.
45
46       It's also possible to invoke kexec without an option parameter. In that
47       case,  kexec  loads  the specified kernel and then invokes shutdown(1).
48       If the shutdown scripts of your Linux distribution support  kexec-based
49       rebooting,  they  then call kexec -e just before actually rebooting the
50       machine. That way, the machine does  a  clean  shutdown  including  all
51       shutdown scripts.
52
53

EXAMPLE

55       For   example,   if   the  kernel  image  you  want  to  reboot  to  is
56       /boot/vmlinux, the contents of /proc/cmdline is root=/dev/hda1, and the
57       path  to  the  initrd is /boot/initrd, then you would use the following
58       command to load the kernel:
59
60              kexec      -l /boot/vmlinux       --append=root=/dev/hda1 --ini‐
61              trd=/boot/initrd
62
63       After  this kernel is loaded, it can be booted to at any time using the
64       command:
65
66              kexec -e
67
68

OPTIONS

70       -e (--exec)
71              Run the currently loaded kernel.
72
73       -f (--force)
74              Force an immediate kexec call, do not call shutdown(1) (contrary
75              to the default action without any option parameter). This option
76              performs the same actions like executing -l and -e in one call.
77
78       -h (--help)
79              Open a help file for kexec.
80
81       -l (--load) kernel
82              Load the specified kernel into the current kernel.
83
84       -p (--load-panic)
85              Load the new kernel for use on panic.
86
87       -t (--type=type)
88              Specify that the new kernel is of this type.
89
90       -u (--unload)
91              Unload the current kexec target kernel. If a capture  kernel  is
92              being unloaded then specify -p with -u.
93
94       -v (--version)
95              Return the version number of the installed utility.
96
97       -x (--no-ifdown)
98              Shut  down  the  running  kernel,  but  restore the interface on
99              reload. (If this option is used, it must be specified last.)
100
101       --mem-min=addr
102              Specify the lowest memory address addr to load code into.
103
104       --mem-max=addr
105              Specify the highest memory address addr to load code into.
106
107

SUPPORTED KERNEL FILE TYPES AND OPTIONS

109       Beoboot-x86
110
111              --args-elf
112                     Pass ELF boot notes.
113
114              --args-linux
115                     Pass Linux kernel style options.
116
117              -d  (--debug)
118                     Enable debugging messages.
119
120              --real-mode
121                     Use the kernel's real mode entry point.
122
123       elf-x86
124
125              --append=string
126                     Append string to the kernel command line.
127
128              --command-line=string
129                     Set the kernel command line to string.
130
131              --reuse-cmdline
132                     Use the command line from  the  running  system.  When  a
133                     panic kernel is loaded, it strips the crashkernel parame‐
134                     ter  automatically.  The  BOOT_IMAGE  parameter  is  also
135                     stripped.
136
137              --initrd=file
138                     Use file as the kernel's initial ramdisk.
139
140              --ramdisk=file
141                     Use file as the kernel's initial ramdisk.
142
143       bzImage-x86
144
145              --append=string
146                     Append string to the kernel command line.
147
148              --command-line=string
149                     Set the kernel command line to string.
150
151              --reuse-cmdline
152                     Use  the  command  line  from  the running system. When a
153                     panic kernel is loaded, it strips the crashkernel parame‐
154                     ter  automatically.  The  BOOT_IMAGE  parameter  is  also
155                     stripped.
156
157              --initrd=file
158                     Use file as the kernel's initial ramdisk.
159
160              --ramdisk=file
161                     Use file as the kernel's initial ramdisk.
162
163              --real-mode
164                     Use real-mode entry point.
165
166       multiboot-x86
167
168              --command-line=string
169                     Set the kernel command line to string.
170
171              --reuse-cmdline
172                     Use the command line from  the  running  system.  When  a
173                     panic kernel is loaded, it strips the crashkernel parame‐
174                     ter  automatically.  The  BOOT_IMAGE  parameter  is  also
175                     stripped.
176
177              --module=mod arg1 arg2 ...
178                     Load module mod with command-line arguments arg1 arg2 ...
179                     This parameter can be specified multiple times.
180
181

ARCHITECTURE OPTIONS

183       --console-serial
184              Enable the serial console.
185
186       --console-vga
187              Enable the VGA console.
188
189       --elf32-core-headers
190              Prepare core headers in ELF32 format.
191
192       --elf64-core-headers
193              Prepare core headers in ELF64 format.
194
195       --reset-vga
196              Attempt to reset a standard VGA device.
197
198       --serial=port
199              Specify the serial port for debug output.
200
201       --serial-baud=baud_rate
202              Specify the baud rate of the serial port.
203
204
205
206Linux                             April 2006                          kexec(8)
Impressum