Linux reboot without resetting the machine

Why would you want to do it? In production environments, downtime needs to be minimised as much as possible. By hotswapping the kernel, we can reload Linux without having to go through the BIOS, POST and GRUB/LILO again, allowing an almost instantaneous reboot. This is very useful after kernel upgrades, or when a system reboot is necessary (quite rarely in fact on a Linux box)

This can be done with the kexec-tools package, obtainable from apt on Debian based systems. Firing off a new kernel is as simple as:

kexec –load=/path/to/kernel –initrd=/path/to/ramdisk –commandline=”bootloader-arguments”

kexec -e

Of course you could make this more abstract, either by getting kernel and ramdisk paths and versions from uname -r or by parsing GRUB/LILO’s boot list.

0 Responses to “Linux reboot without resetting the machine”


  • No Comments

Leave a Reply