Questions tagged [kexec]

kexec is a system call that enables to load and boot into another kernel from the currently running kernel.

Filter by
Sorted by
Tagged with
1 vote
2 answers
38 views

5.4 Linux kernel on x86 panics with alignment exception when kexec'ed from 6.1 kernel

The boot chain here is UEFI -> 6.1.14 kernel built with EFI stub, initramfs loads and checks 5.4.109 kernel, then kexecs it. CPU is a 2-core Intel Atom N6210. When booted this way, at startup when ...
0 votes
0 answers
50 views

How to gracefully shutdown and perform a kexec

How can I shutdown and kexec gracefully while preserving the kernel command line arguments? My original solution was to use systemctl kexec however it overwrites any command line arguments set via ...
0 votes
0 answers
27 views

systemctl kexec works only once

I can boot a new kernel with systemctl kexec, but when I try from the system it reports an error: booting with kexec I am using NixOS with the 5.15.78 and 6.0.8 kernels. Anyone know why this is ...
0 votes
0 answers
53 views

Add additional parameter after running Kexec -l

I want to run Kexec -l to load a kernel, but before I run Kexec -e I want to add additional kernel parameters without running Kexec -l again. I tried running Kexec -e --append=STRING but it doesn't ...
0 votes
1 answer
219 views

How to chainload another kernel with kexec inside a LUKS2 + LVM2 partition?

I have a Debian 11 installation with the following partition layout: path format mount point /dev/nvme0n1p7 ext4 (no encryption) /boot (Debian 11) /dev/nvme0n1p8 dm-crypt LUKS2 LVM2 (named vg_main) ...
  • 103
0 votes
1 answer
643 views

Unable to Get Kernel Crash Dump on Kernel Panic

I'm using kexec-tools to get a crash dump of kernel on kernel panic. However, when I trigger the panic using sysrq-trigger, the system freezes. I have to power off and then power on to restore the ...
  • 99
1 vote
0 answers
167 views

Load a second kernel at boot

At boot, the bootloader loads a kernel, let's say vmlinuz1. Is there a way to pass some kind of parameters to it in order to chainload another kernel (let's say vmlinuz2)? I know kexec can load ...
2 votes
0 answers
518 views

How should I fix a failed kexec that produces "CPUs are stuck in the kernel" in dmesg?

I have built both a kernel from the Raspberry Pi sources and kexec-tools for arm64, and booted my kernel on a Raspberry Pi 4. When I attempt to run kexec, it produces no output, exits with a nonzero ...
-2 votes
1 answer
2k views

Installing `kali-win-kex` on WSL2 fails

I tried installing Kali-Win-Kex by following the official guide. $ sudo apt install kali-win-kex -y dpkg: error processing archive /var/cache/apt/archives/kali-win-kex_2.7_amd64.deb (--unpack):...
4 votes
1 answer
1k views

kexec reboot no longer skips firmware/hard reboot after upgrade to ubuntu 20.04

(Posting here rather than the Ubuntu subsite because I don't think it's specifically related to Ubuntu...) I've previously been successfully using kexec-reboot -lr from the exceptionally useful page ...
  • 489
1 vote
0 answers
148 views

If retain_initrd is used, can this cpio image be accessed from userspace?

By default, the Linux kernel frees the memory that was used for an initramfs after its unpack is complete. If the kernel argument retain_initrd is used, then kexec --reuseinitrd becomes available to --...
0 votes
1 answer
308 views

Reboot with kexec without making it default and vice versa

Upon installing kexec-tools, on Ubuntu at least, I am asked if I want to use kexec to handle all invocations of reboot. I don't, but there are some occasions that I do want graceful termination of ...
  • 3,708
1 vote
1 answer
360 views

SSH key added on boot without password prompt - how and why?

I have a passphrase-protected SSH key stored in ~/.ssh/id_rsa. In my .zshrc I have this fragment: if ! ssh-add -l > /dev/null; then ssh-add fi After booting, I usually open the terminal, see ...
  • 678
3 votes
1 answer
2k views

How to reset the video mode of the Intel driver i915 for the kexec-ed kernel so I can see what kexec kernel is doing?

I'm running Arch Linux and I've set up kdump so that when the current kernel panics(or I manually induce a crash via sysrq+c) then another kernel(the kexec kernel) starts up in order to create a crash ...
user avatar
2 votes
2 answers
1k views

Kexec into new kernel, but I can't access the initramfs prompt!

I used kexec to successfully load my kernel, but it's just printing dmesg lines. How do I get out of this to drop into the initramfs prompt? Ctrl-Alt-F2 just loads a black screen and ctrl-c does ...
4 votes
0 answers
1k views

Hard lockup triggers reboot but no panic and no kdump

I have been trying to debug random system freezes when running the 4.14.93-rt kernel. To this end, I have enabled the lockup detector in the kernel using the following config: ...
  • 41
3 votes
0 answers
271 views

kexec: relocate_kernel fails

I am not able to get kexec to work. For x86_64 relocate_kernel fails to store information for jumping back. Kexec stops in movq %r9, CP_PA_TABLE_PAGE(%r11). works fine for kernel 4.4.162, doesn't ...
1 vote
1 answer
8k views

How to umount /var /usr safely on systemd without reboot

I have a Linux server on a VM which the reboot does work as powering off due to misconfiguration of a third part provider. I do not have access to VM configuration. The person who installed the ...
1 vote
1 answer
154 views

Could the capture kernel be used as a normal kernel after a kexec?

I have read about the kexec/kdump facilities, we know that crashed/panic'ed kernel is made available via /proc/vmcore. I have heard people use kexec based booting to bypass EFI/BIOS/FW initialization ...
8 votes
5 answers
3k views

Kexec to GRUB (or to Syslinux, or Windows)

I have an application where I need to boot to Linux, execute automated scripts and then automatically boot to Windows. Can I use Kexec to run grub? Another use case would be to boot a Linux kernel to ...
  • 1,522
1 vote
0 answers
49 views

Boot Linux from Linux on embedded board

I'd like to know, is there a way to boot a new Linux system, from a Linux ? Let me explain : I want to keep 2 systems separated on an embedded board. One system is used to perform tasks at the ...
  • 101
9 votes
2 answers
3k views

How to check if currently running Linux kernel has been loaded with kexec?

By checking I mean something quite rock-solid, i. e., trying to analyse loader's configuration or available kernel files and matching to uname's output clearly isn't an option.
  • 6,118
14 votes
2 answers
3k views

Reboot without having to decrypt LUKS partitions?

Is there a way to kexec reboot a running kernel without having to decrypt an encrypted LUKS root filesystem? I'd imagine not, but I'm not sure if there's a workaround for this.
  • 37.8k
3 votes
0 answers
2k views

Boot rescue kernel at high memory address using kexec on arm

Summary: Crashkernel boots at 512MB address in RAM with kexec -e/-l but not with kexec -p - why? Embedded platform with Marvell Armada XP (MV78460) (ARMv7 with 4 cores) and 1GB of RAM. production ...
7 votes
1 answer
1k views

kexec and USE_GRUB_CONFIG

I find kexec very useful to speed-up the reboot of Linux servers. One parameter into /etc/default/kexec is USE_GRUB_CONFIG. This parameter is meant to "read Grub configuration file". But I don't ...
3 votes
1 answer
966 views

kexec crashing when booting a kernel without initramfs (ARM)

First, a few details about the setup: Linux-3.14.1 ARM am335x chip U-Boot bootloader What I am trying to achieve: U-Boot loads a kernel that contains an initramfs (call this kernel 1). U-Boot ...
4 votes
0 answers
391 views

kexec doesn't unmount root filesystem

With a Debian Jessie 8.0, freshly installed (with systemd), I installed kexec. When I restart the computer with the reboot command, this invoke kexec. The reboot is ok but I have a message into the ...
4 votes
1 answer
484 views

does the second kernel need kexec enabled

It's clear that you need the kexec syscalls in the 'first' kernel. But does the kernel that should get loaded (with kexec_load and reboot) need to be compiled with kexec? If yes, what extra code ...
  • 245
4 votes
2 answers
2k views

Easy way initrd to chain loading another kernel with kexec

I have here a machine which won't boot 64-bit kernels (it has efi32 with a little bit of... uncommon firmware). Currently, my only way to boot my 64-bit linux system is: Booting a 32-bit distro from ...
  • 9,192