• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

kexec: command not found

by Deepika

“kexec” is a Linux system call that enables the kernel to load and boot into another kernel, bypassing the BIOS or firmware boot loader. This allows the system to reboot directly into a new kernel without going through the process of shutting down and restarting the system.

The kexec system call is useful in several scenarios, such as:

  • Developers who are testing new kernels and want to quickly switch between different versions without the need for a complete reboot.
  • It can be used in situations where the system is unable to boot due to a problem with the current kernel, and a new kernel is needed to fix the issue.

The kexec system call requires the kernel and initrd (initial ramdisk) of the new kernel to be loaded into memory before executing the kexec system call. This means that the new kernel must be compatible with the current hardware and must have the necessary drivers and modules required to boot the system.

It’s important to note that kexec is not a replacement for a full reboot and is not suitable for all cases. Also, it should be used with care as it may cause data loss and system instability if not used properly.

If you encounter the below error while running the command kexec:

kexec: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install kexec-tools
Ubuntu apt-get install kexec-tools
Arch Linux pacman -S kexec-tools
Kali Linux apt-get install kexec-tools
CentOS yum install kexec-tools
Fedora dnf install kexec-tools
Raspbian apt-get install kexec-tools

kexec Command Examples

1. Load a new kernel:

# kexec -l path/to/kernel --initrd=path/to/initrd --command-line=arguments

2. Load a new kernel with current boot parameters:

# kexec -l path/to/kernel --initrd=path/to/initrd --reuse-cmdline

3. Execute a currently loaded kernel:

# kexec -e

4. Unload current kexec target kernel:

# kexec -u

Filed Under: Linux

Some more articles you might also be interested in …

  1. phar: command not found
  2. taskset Command Examples in Linux
  3. How to activate and mount 2 Volume groups with same names in CentOS/RHEL
  4. depmod: command not found
  5. terminator: command not found
  6. trust: command not found
  7. gunzip Command Examples in Linux
  8. Upgrading from CentOS/RHEL 7 to CentOS/RHEL 8 using Leapp
  9. How to (Correctly) Change the UID and GID of a user/group in Linux
  10. How to use “yum downloadonly” to download a package without installing it

You May Also Like

Primary Sidebar

Recent Posts

  • “aws sqs” Command Examples
  • “aws ses” Command Examples
  • “aws secretsmanager” Command Examples
  • “aws s3api” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright