Forrest logo
back to the kexec tool

kexec:tldr:4d212

kexec: Unload current kexec target kernel.
$ kexec -u
try on your machine

The command "kexec -u" is used to unload the currently running Linux kernel and replace it with a new kernel image without rebooting the system.

Here is a breakdown of the command:

  • "kexec": Short for "kernel execute," it is a Linux utility that allows the execution of a new kernel on a running system without going through the normal boot process.
  • "-u": This option instructs kexec to unload the currently running kernel and prepare for the execution of a new kernel.

When executed, "kexec -u" performs the following steps:

  1. The current kernel is halted, and control is transferred to the kexec utility.
  2. Kexec validates the new kernel image provided to ensure its integrity.
  3. All memory currently used by the running kernel is freed up.
  4. The new kernel image is loaded into memory, including its necessary modules and device tree (if applicable).
  5. The new kernel is then executed, taking over control of the system.

By using "kexec -u," system administrators or developers can quickly switch to a new kernel version without the need for a full system reboot, reducing the downtime and allowing for easier testing or upgrades of the kernel.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the kexec tool