Slashdot Mirror


Reboot Linux Faster Using kexec

An anonymous reader writes "Even if your work doesn't require you to reboot your Linux machine several times a day, waiting for a system to reboot can be a real drag. Enter kexec. Essentially, kexec is a fast reboot feature that lets you reboot to a new Linux kernel -- without having to go through a bootloader. Faster reboot is a benefit even when uptime isn't mission-critical -- and a lifesaver for kernel and system software developers who need to reboot their machines several times a day. Kexec is currently available on the x86 32-bit platform only."

10 of 59 comments (clear)

  1. Avoid BIOS by crow · · Score: 3, Informative

    Rebooting a box that has SCSI drives means that the BIOS does a scan of the SCSI bus that takes a while, and then the new kernel does the same thing. That's the slowest part of my boot process, and it looks like kexec will bypass the BIOS half of it.

    1. Re:Avoid BIOS by cyb97 · · Score: 3, Informative

      usually the slowest part of booting a scsi-kernel is "waiting for scsi-devices to settle". Which is usually set to 15s for quite a few drivers in the kernel. Bumping that down to a resonably low number like 2-3 s (usually enough for modern devices, would skimp 10-13s of you boot-time ;-)

  2. Equivalent by Anonymous Coward · · Score: 1, Informative

    In 'Windos' terms, this is equivalent to the 'shift+restart' feature on earlier windows. You would press shift while hitting restart and it would only restart without rebooting the machine.

  3. BIOS by ggeens · · Score: 4, Informative

    The boot loader spends most of its time waiting for the user to press a key, so they can enter custom boot parameters. If you set the timeout to 0 in LILO or GRUB, loading the kernel happens almost instantly.

    The BIOS startup routine is longer, especially if you have a SCSI card. (I have 2 of those in my machine, and they account for most of the wait during startup.)

    --
    WWTTD?
  4. Quicker reboots? by sweede · · Score: 3, Informative

    If you read the article, it says that kexec doesnt do a normal,clean shutdown, so you have to stop all running programs and unmount all partitions before running kexec to do a reboot.

    When i boot into linux, it takes longer to start up services than it does to go through the BIOS, SATA raid controller BIOS, grub's 3 second time out, and the loading of the linux kernel (before initd takes over).

    however, this program is still in ints infancy and no doubt someone will create an initd that can utilize kexec in a run level for rebooting without a full shutdown. But I dont think it will be that much quicker.

    --
    I follow the SDK and GDN principles.. Spelling Dont Kount, Grammer Dont Neither
    1. Re:Quicker reboots? by Marillion · · Score: 2, Informative
      Perhaps something like, dropping to run level 1 first, then remount all drives as readonly.

      # init 1
      # mount -o remount,ro -a
      # kexec ...
      --
      This is a boring sig
  5. Re:Init scripts... by Fweeky · · Score: 2, Informative

    Try using a system which doesn't kill each service one by one in a serial manner; the difference between shutdown speed in, say, Slackware or FreeBSD compared with RedHat and friends is quite significant. You'll have to learn to live without the fancy green [OK]'s though :)

  6. Re:What's taking it so long? by 0x0d0a · · Score: 2, Informative

    You are right. Something is decidedly wrong on your system. It takes me, IIRC, under a second to go from "bootloader screen" to "kernel spitting out init data". It is definitely not twenty seconds.

    Now, the time spent sitting in init scripts when a desktop could be brought up much faster and initscript loading continued in the background is an arguable issue...

  7. Re:Speeding up boot by oojah · · Score: 2, Informative

    The biggest gain I can think of would be moving from an initscript system in which all services are serially numered to one where dependencies are expressed with a directed acyclic graph. All you have is "X depends on network being up" "cups depends on network being up", etc.

    You mean like in Gentoo?

    Roger
    --
    Do you have any better hostages?
  8. You mean like in FreeBSD? by Ayanami+Rei · · Score: 2, Informative

    You mean like BSD init + rcorder, which predates Gentoo.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON