How to use kexec on Ubuntu Bionic with GRUB-EFI
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
Since the upgrade to Ubuntu 18.04 Bionic kexec stopped working on my laptop.
Ubuntu is installed in UEFI mode with GRUB as the bootloader, dual booting Windows. The system is fully encrypted, including the boot partition.
I have kexec-tools installed and added the following service:
[Unit]
DefaultDependencies=no
Requires=sysinit.target
After=sysinit.target
[Service]
Type=oneshot
ExecStart=-/bin/true
RemainAfterExit=yes
ExecStop=/usr/local/bin/load-kexec.sh
[Install]
WantedBy=basic.target
and this script to do the kexec reboot:
#!/bin/sh
INITRAMFS="/initrd.img";
KERNEL="/vmlinuz";
if [ "$(cat /sys/kernel/kexec_loaded)" != "1" ]; then
echo "Load kernel ($KERNEL) and initramfs ($INITRAMFS) for kexec";
kexec -l "$KERNEL" --initrd="$INITRAMFS" --reuse-cmdline;
else
echo "Already loaded some kexec, not modifying";
fi;
However, running sudo systemctl kexec
gives me this error message:
Failed to open "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to read boot config from "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to load bootspec config from "/boot/efi/loader": Datei oder Verzeichnis nicht gefunden
It is right about the fact that this configuration file does not exist, but I did not need to create it on Ubuntu 16.04 where kexec worked flawlessly.
Can somebody explain what changed in the upgrade and how to get kexec working again?
boot uefi systemd
add a comment |Â
up vote
1
down vote
favorite
Since the upgrade to Ubuntu 18.04 Bionic kexec stopped working on my laptop.
Ubuntu is installed in UEFI mode with GRUB as the bootloader, dual booting Windows. The system is fully encrypted, including the boot partition.
I have kexec-tools installed and added the following service:
[Unit]
DefaultDependencies=no
Requires=sysinit.target
After=sysinit.target
[Service]
Type=oneshot
ExecStart=-/bin/true
RemainAfterExit=yes
ExecStop=/usr/local/bin/load-kexec.sh
[Install]
WantedBy=basic.target
and this script to do the kexec reboot:
#!/bin/sh
INITRAMFS="/initrd.img";
KERNEL="/vmlinuz";
if [ "$(cat /sys/kernel/kexec_loaded)" != "1" ]; then
echo "Load kernel ($KERNEL) and initramfs ($INITRAMFS) for kexec";
kexec -l "$KERNEL" --initrd="$INITRAMFS" --reuse-cmdline;
else
echo "Already loaded some kexec, not modifying";
fi;
However, running sudo systemctl kexec
gives me this error message:
Failed to open "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to read boot config from "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to load bootspec config from "/boot/efi/loader": Datei oder Verzeichnis nicht gefunden
It is right about the fact that this configuration file does not exist, but I did not need to create it on Ubuntu 16.04 where kexec worked flawlessly.
Can somebody explain what changed in the upgrade and how to get kexec working again?
boot uefi systemd
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Since the upgrade to Ubuntu 18.04 Bionic kexec stopped working on my laptop.
Ubuntu is installed in UEFI mode with GRUB as the bootloader, dual booting Windows. The system is fully encrypted, including the boot partition.
I have kexec-tools installed and added the following service:
[Unit]
DefaultDependencies=no
Requires=sysinit.target
After=sysinit.target
[Service]
Type=oneshot
ExecStart=-/bin/true
RemainAfterExit=yes
ExecStop=/usr/local/bin/load-kexec.sh
[Install]
WantedBy=basic.target
and this script to do the kexec reboot:
#!/bin/sh
INITRAMFS="/initrd.img";
KERNEL="/vmlinuz";
if [ "$(cat /sys/kernel/kexec_loaded)" != "1" ]; then
echo "Load kernel ($KERNEL) and initramfs ($INITRAMFS) for kexec";
kexec -l "$KERNEL" --initrd="$INITRAMFS" --reuse-cmdline;
else
echo "Already loaded some kexec, not modifying";
fi;
However, running sudo systemctl kexec
gives me this error message:
Failed to open "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to read boot config from "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to load bootspec config from "/boot/efi/loader": Datei oder Verzeichnis nicht gefunden
It is right about the fact that this configuration file does not exist, but I did not need to create it on Ubuntu 16.04 where kexec worked flawlessly.
Can somebody explain what changed in the upgrade and how to get kexec working again?
boot uefi systemd
Since the upgrade to Ubuntu 18.04 Bionic kexec stopped working on my laptop.
Ubuntu is installed in UEFI mode with GRUB as the bootloader, dual booting Windows. The system is fully encrypted, including the boot partition.
I have kexec-tools installed and added the following service:
[Unit]
DefaultDependencies=no
Requires=sysinit.target
After=sysinit.target
[Service]
Type=oneshot
ExecStart=-/bin/true
RemainAfterExit=yes
ExecStop=/usr/local/bin/load-kexec.sh
[Install]
WantedBy=basic.target
and this script to do the kexec reboot:
#!/bin/sh
INITRAMFS="/initrd.img";
KERNEL="/vmlinuz";
if [ "$(cat /sys/kernel/kexec_loaded)" != "1" ]; then
echo "Load kernel ($KERNEL) and initramfs ($INITRAMFS) for kexec";
kexec -l "$KERNEL" --initrd="$INITRAMFS" --reuse-cmdline;
else
echo "Already loaded some kexec, not modifying";
fi;
However, running sudo systemctl kexec
gives me this error message:
Failed to open "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to read boot config from "/boot/efi/loader/loader.conf": Datei oder Verzeichnis nicht gefunden
Failed to load bootspec config from "/boot/efi/loader": Datei oder Verzeichnis nicht gefunden
It is right about the fact that this configuration file does not exist, but I did not need to create it on Ubuntu 16.04 where kexec worked flawlessly.
Can somebody explain what changed in the upgrade and how to get kexec working again?
boot uefi systemd
asked May 18 at 11:24
RenWal
737
737
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
Datei oder Verzeichnis nicht gefunden
In English this means: "File or directory not found"
Looking at loader.conf â Configuration file for sd-boot it says:
sd-boot(7) will read
/loader/loader.conf
and any files with the
".conf
" extension under/loader/loader.conf.d/
on the EFI system
partition (ESP).
Although I don't have time to test kexec
tonight, you should be able to fix the error with the command:
sudo mkdir -p /boot/efi/loader/loader.conf.d/
No entry suitable as default, refusing to guess
The initial error message said no file or directory. I was hoping creating a directory would make it happy. Here is a default loader.conf
file:
# Example kexec-loader configuration file
# Read the documentation for more information.
#
# Number of seconds to wait before booting the default menu entry.
#
# timeout 5
# Explicitly enable/disable GRUB autodetection. Autodetection will be enabled
# by default, but only if no boot targets are specified in this file.
#
# grub-autodetect on
# grub-autodetect off
# Force GRUB path. Setting this will disable autodetection.
#
# grub-path (hda1)/boot/grub
# Map GRUB disks/partitions
# This overrides any mappings in device.map
#
# grub-map hd0 sda
# grub-map hd1,a hda8
# Example boot target
#
# title Generic Linux System
# root hda1
# kernel /boot/vmlinuz
# cmdline root=/dev/hda1 ro
# initrd /boot/initrd.gz
Thanks! I tried your suggestion, but now it gives meNo entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?
â RenWal
May 19 at 7:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
The sample file still saysNo entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Datei oder Verzeichnis nicht gefunden
In English this means: "File or directory not found"
Looking at loader.conf â Configuration file for sd-boot it says:
sd-boot(7) will read
/loader/loader.conf
and any files with the
".conf
" extension under/loader/loader.conf.d/
on the EFI system
partition (ESP).
Although I don't have time to test kexec
tonight, you should be able to fix the error with the command:
sudo mkdir -p /boot/efi/loader/loader.conf.d/
No entry suitable as default, refusing to guess
The initial error message said no file or directory. I was hoping creating a directory would make it happy. Here is a default loader.conf
file:
# Example kexec-loader configuration file
# Read the documentation for more information.
#
# Number of seconds to wait before booting the default menu entry.
#
# timeout 5
# Explicitly enable/disable GRUB autodetection. Autodetection will be enabled
# by default, but only if no boot targets are specified in this file.
#
# grub-autodetect on
# grub-autodetect off
# Force GRUB path. Setting this will disable autodetection.
#
# grub-path (hda1)/boot/grub
# Map GRUB disks/partitions
# This overrides any mappings in device.map
#
# grub-map hd0 sda
# grub-map hd1,a hda8
# Example boot target
#
# title Generic Linux System
# root hda1
# kernel /boot/vmlinuz
# cmdline root=/dev/hda1 ro
# initrd /boot/initrd.gz
Thanks! I tried your suggestion, but now it gives meNo entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?
â RenWal
May 19 at 7:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
The sample file still saysNo entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
add a comment |Â
up vote
0
down vote
Datei oder Verzeichnis nicht gefunden
In English this means: "File or directory not found"
Looking at loader.conf â Configuration file for sd-boot it says:
sd-boot(7) will read
/loader/loader.conf
and any files with the
".conf
" extension under/loader/loader.conf.d/
on the EFI system
partition (ESP).
Although I don't have time to test kexec
tonight, you should be able to fix the error with the command:
sudo mkdir -p /boot/efi/loader/loader.conf.d/
No entry suitable as default, refusing to guess
The initial error message said no file or directory. I was hoping creating a directory would make it happy. Here is a default loader.conf
file:
# Example kexec-loader configuration file
# Read the documentation for more information.
#
# Number of seconds to wait before booting the default menu entry.
#
# timeout 5
# Explicitly enable/disable GRUB autodetection. Autodetection will be enabled
# by default, but only if no boot targets are specified in this file.
#
# grub-autodetect on
# grub-autodetect off
# Force GRUB path. Setting this will disable autodetection.
#
# grub-path (hda1)/boot/grub
# Map GRUB disks/partitions
# This overrides any mappings in device.map
#
# grub-map hd0 sda
# grub-map hd1,a hda8
# Example boot target
#
# title Generic Linux System
# root hda1
# kernel /boot/vmlinuz
# cmdline root=/dev/hda1 ro
# initrd /boot/initrd.gz
Thanks! I tried your suggestion, but now it gives meNo entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?
â RenWal
May 19 at 7:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
The sample file still saysNo entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Datei oder Verzeichnis nicht gefunden
In English this means: "File or directory not found"
Looking at loader.conf â Configuration file for sd-boot it says:
sd-boot(7) will read
/loader/loader.conf
and any files with the
".conf
" extension under/loader/loader.conf.d/
on the EFI system
partition (ESP).
Although I don't have time to test kexec
tonight, you should be able to fix the error with the command:
sudo mkdir -p /boot/efi/loader/loader.conf.d/
No entry suitable as default, refusing to guess
The initial error message said no file or directory. I was hoping creating a directory would make it happy. Here is a default loader.conf
file:
# Example kexec-loader configuration file
# Read the documentation for more information.
#
# Number of seconds to wait before booting the default menu entry.
#
# timeout 5
# Explicitly enable/disable GRUB autodetection. Autodetection will be enabled
# by default, but only if no boot targets are specified in this file.
#
# grub-autodetect on
# grub-autodetect off
# Force GRUB path. Setting this will disable autodetection.
#
# grub-path (hda1)/boot/grub
# Map GRUB disks/partitions
# This overrides any mappings in device.map
#
# grub-map hd0 sda
# grub-map hd1,a hda8
# Example boot target
#
# title Generic Linux System
# root hda1
# kernel /boot/vmlinuz
# cmdline root=/dev/hda1 ro
# initrd /boot/initrd.gz
Datei oder Verzeichnis nicht gefunden
In English this means: "File or directory not found"
Looking at loader.conf â Configuration file for sd-boot it says:
sd-boot(7) will read
/loader/loader.conf
and any files with the
".conf
" extension under/loader/loader.conf.d/
on the EFI system
partition (ESP).
Although I don't have time to test kexec
tonight, you should be able to fix the error with the command:
sudo mkdir -p /boot/efi/loader/loader.conf.d/
No entry suitable as default, refusing to guess
The initial error message said no file or directory. I was hoping creating a directory would make it happy. Here is a default loader.conf
file:
# Example kexec-loader configuration file
# Read the documentation for more information.
#
# Number of seconds to wait before booting the default menu entry.
#
# timeout 5
# Explicitly enable/disable GRUB autodetection. Autodetection will be enabled
# by default, but only if no boot targets are specified in this file.
#
# grub-autodetect on
# grub-autodetect off
# Force GRUB path. Setting this will disable autodetection.
#
# grub-path (hda1)/boot/grub
# Map GRUB disks/partitions
# This overrides any mappings in device.map
#
# grub-map hd0 sda
# grub-map hd1,a hda8
# Example boot target
#
# title Generic Linux System
# root hda1
# kernel /boot/vmlinuz
# cmdline root=/dev/hda1 ro
# initrd /boot/initrd.gz
edited May 19 at 16:44
answered May 19 at 0:58
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
WinEunuuchs2Unix
34.6k756131
34.6k756131
Thanks! I tried your suggestion, but now it gives meNo entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?
â RenWal
May 19 at 7:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
The sample file still saysNo entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
add a comment |Â
Thanks! I tried your suggestion, but now it gives meNo entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?
â RenWal
May 19 at 7:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
The sample file still saysNo entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
Thanks! I tried your suggestion, but now it gives me
No entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?â RenWal
May 19 at 7:44
Thanks! I tried your suggestion, but now it gives me
No entry suitable as default, refusing to guess.
If I understood this correctly, loader.conf would be the configuration file for systemd-boot (former gummiboot bootloader) - but I am using GRUB, so why is this file needed anyway?â RenWal
May 19 at 7:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
@RenWal I've revised the answer with a sample configuration file.
â WinEunuuchs2Unix
May 19 at 16:44
The sample file still says
No entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
The sample file still says
No entry suitable as default, refusing to guess.
â sup
May 21 at 18:28
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037733%2fhow-to-use-kexec-on-ubuntu-bionic-with-grub-efi%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password