3

I'm finding that grub-reboot works only on a cold reboot (shutdown and then manual boot), but not on a simple reboot or shutdown -r. With these usual reboot commands, Ubuntu 16.04 occasionally shows a few Clearing orphaned inode messages, and then immediately goes back into Started new Kernel Device Manager (with the shutdown and startup messages often even interleaved). I never see the GRUB2 screen, and, more importantly, I never get booted into my alternate grub entry.

OTOH, if I shut down and then manually power-on the machine, I see that grub-reboot has indeed marked the correct temporary option (not the one I've just left).

As the whole point of grub-reboot, for me, is to switch OS remotely, this isn't a good option.

How can I reboot and see GRUB?

1

The system in question is configured for kexec, so it's never going down as far as the bootloader or firmware.

The general idea behind kexec is to avoid the insane POST times seen on a lot of server hardware to reduce down time when you need to upgrade your kernel. It's got a few other neat uses too (it's used on some distributions for handling crash dumps, and can even be used to switch between running Linux directly on the hardware and running it inside the Xen hypervisor).

There are two options to handle this.

  1. Figure out how to properly disable kexec (either via disabling the init script that's loading the new kernel, or by uninstalling the kexec command which should be in a package called kexec-tools on Ubuntu). Unfortunately, this is rather system specific, and I have no idea how Ubuntu handles kexec these days, so I can't give much advice here.

  2. Manually unload the kexec kernel prior to issuing the reboot command by running the command kexec -u as root. This will only work if the loading is done during startup or when installing a new kernel package (though I think this is how Ubuntu handles it, I'm not certain). Alternatively, if using systemd, calling systemctl reboot instead of just reboot might bypass the use of a kexec kernel, but I'm not certain about that.

  • 1
    kexec is it; thanks. From a comment on this page, I found that changing the line LOAD_KEXEC=true to LOAD_KEXEC=false in /etc/default/kexec was enough. – tsbertalan Nov 9 '17 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.