This is a draft document that was built and uploaded automatically. It may document beta software and be incomplete or even incorrect. Use this document at your own risk.

Jump to content
Using Kexec for Faster Reboots
SUSE Linux Enterprise Server for NVIDIA 16.1

Using Kexec for Faster Reboots

Publication Date: 19 Nov 2026

Kexec boots a new Linux kernel directly from a running kernel, bypassing firmware initialization and the boot loader. A normal reboot runs these steps before the new kernel starts, which takes time, especially on servers. With Kexec, you can skip both steps and reduce server downtime during routine kernel updates. This article explains when a Kexec reboot is useful, when you still need a full reboot and how to reboot with Kexec on SUSE Linux Enterprise Server for NVIDIA.

Prerequisites

  • The kexec-tools and update-bootloader packages, which are installed by default

1 What is Kexec?

Kexec is a Linux kernel mechanism that starts a new kernel directly from the running kernel, without going through the firmware and the boot loader. A reboot with Kexec is therefore faster than a normal reboot.

The kexec command from the kexec-tools package loads the new kernel into memory through the kexec system call. The running kernel then hands control to the new kernel.

1.1 When to reboot with Kexec

  • Faster reboots. Skipping the firmware and the boot loader saves time, which matters if you reboot a system often, for example, after kernel updates.

  • Booting another kernel once. You can load any kernel image with the kernel options you choose, without changing the boot loader configuration.

1.2 When to use a full reboot

Use a full reboot when you need the firmware or the boot loader to run:

  • Firmware updates. Changes to the firmware take effect only when the firmware runs during a full reboot.

  • Selecting an entry in the boot menu. A Kexec reboot does not show the boot menu, so you cannot select another boot entry or an older snapshot there.

  • Devices that do not work after a Kexec reboot. A full reboot lets the firmware reset and initialize the hardware.

If a kernel is already loaded for Kexec, unload it before a full reboot. Otherwise, systemctl reboot also reboots with Kexec. See Section 2, “Rebooting a system with Kexec”.

2 Rebooting a system with Kexec

Rebooting with Kexec is a two-step process: loading a target kernel and its initrd into memory, either automatically from the default boot loader entry or manually with custom parameters, and triggering the reboot with systemctl kexec.

The kexec-tools package provides the kexec command. kexec-bootloader, which loads the default boot entry, is part of the update-bootloader package. Both packages are installed by default. To confirm that they are present:

>  rpm -q kexec-tools update-bootloader
Important
Important: Unapplied boot loader changes take effect

kexec-bootloader loads the default boot entry with the kernel options that are currently set in the boot loader configuration. These options include changes in /etc/default/grub that you have not applied yet.

  1. Make sure no important services are running and no users other than yourself are logged in, since a Kexec reboot restarts the system immediately once triggered.

  2. Optional: Check which kernel, initrd and kernel options will be loaded, without loading anything:

    > sudo  kexec-bootloader --dry-run -D
  3. Load the default boot entry into memory:

    > sudo  kexec-bootloader
  4. Optional: To do a full reboot after all, for example, for a pending firmware update, unload the kernel:

    > sudo  kexec -u

    As long as a kernel is loaded, every reboot uses Kexec, including a reboot with systemctl reboot. After unloading, reboot with systemctl reboot instead of continuing with the next step.

  5. Reboot with Kexec:

    > sudo  systemctl kexec

    systemctl kexec shuts down the system cleanly and then starts the loaded kernel. If no kernel is loaded, the command tries to find one itself. Automatic loading only works on systems that boot with UEFI and use boot entries that follow the Boot Loader Specification. Otherwise, the command fails with No kexec kernel loaded and autodetection failed. In that case, load the kernel first with kexec-bootloader.

  6. Once the system is back, check the kernel messages of the current boot for warnings:

    > sudo  journalctl -k -p warning -b

    Then confirm that the system is running the expected kernel:

    >  uname -r

2.1 Loading a kernel manually

To start a kernel other than the default boot entry, or a kernel with different options, load it with kexec -l and name the kernel, initrd and kernel options yourself:

> sudo  kexec -l KERNEL_IMAGE --initrd=INITRD_IMAGE --append="KERNEL_OPTIONS"

On SLE for NVIDIA, kernel images are in /usr/lib/modules/KERNEL_VERSION/, and initrds are in /boot/initrd-KERNEL_VERSION. The kernel image file is named Image.

To reuse the kernel options of the running system, use --reuse-cmdline instead of --append.

Example 1: Loading the running kernel again with its current options
> sudo  kexec -l /usr/lib/modules/$(uname -r)/Image \
    --initrd=/boot/initrd-$(uname -r) --reuse-cmdline

Then reboot with systemctl kexec, which shuts down the system cleanly before it starts the loaded kernel. kexec -e also starts the loaded kernel, but immediately and without calling shutdown(8), so services are not stopped cleanly.

3 For more information

  • Man pages: man 8 kexec, man 8 kexec-bootloader, man 1 systemctl.

  • For capturing kernel crash dumps with Kdump, which also uses Kexec, see the article “Capturing and Analyzing Kernel Crash Dumps with Kdump”.

  • Man page for Kexec with the full set of command-line options: https://man7.org/linux/man-pages/man8/kexec.8.html.