Sunday, July 15, 2012

kexec makes boot bypass grub

In my two Debian Squeeze Xfce installations, if I rebooted the computer in either of the following three ways, the grub menu was being skipped and I was taken directly to Squeeze's log-in screen:

- Doing a "Restart" from within an Xfce session.
- Restarting from the log-in screen.
- Issuing shutdown -r now from the command line.

Both of those installations were done with Debian Live via a Unetbootin flash drive. It appears that Debian Live installs the package kexec-tools. A look at man kexec explains the situation:

kexec is a system call that enables you to load and boot into another kernel from the currently running kernel. kexec performs the function of the boot loader from within the kernel. The primary difference between a standard system boot and a kexec boot is that the hardware initialization normally performed by the BIOS or firmware (depending on architecture) is not performed during a kexec boot. This has the effect of reducing the time required for a reboot.

I can see where that would be a nice tool to have, but for my multi-boot set-ups, I need to get back to the grub menu unless I'm wanting to boot back into the same system I started out in. I was having to completely shut the computer down, then boot it back up again. Uncool.

kexec-tools can be removed with the following command:

# apt-get remove kexec-tools

In my case, I went to Synaptic, found the package, marked it for "complete removal," and got rid of it that way.

Optionally, kexec can be disabled by editing the file /etc/default/kexec, changing the value of LOAD_KEXEC from true to false.

I also found the following comment at this web page:

kexec-tools 2.0.2-1 and newer also include a command /sbin/coldreboot which performs the regular cold reboot going all the way into BIOS. If you have installed kexec-tools and use the kexec functionality, you can use coldreboot for the times when you want the machine to go all the way down to BIOS and GRUB.

Here in Debian Squeeze, it was kexec-tools version 2.0.1-4, so that didn't apply anyway.

No comments: