Results 1 to 5 of 5

Thread: GRUB Automatic Boot After Crash

  1. #1
    Join Date
    Feb 2010
    Beans
    11

    GRUB Automatic Boot After Crash

    I'm running Ubuntu 10.10 Server, and anytime my system crashes and starts back up, GRUB prompts for an OS to run. Since I'm usually not at my server to press enter, how do I get it to boot automatically?

  2. #2
    Join Date
    Jul 2009
    Beans
    63

    Re: GRUB Automatic Boot After Crash

    In /etc/default/grub:
    the line
    GRUB_TIMEOUT=600
    Time in seconds.

  3. #3
    Join Date
    Feb 2010
    Beans
    11

    Re: GRUB Automatic Boot After Crash

    Quote Originally Posted by mathgeek2000 View Post
    In /etc/default/grub:
    the line

    Time in seconds.
    Thanks, but that seems to be the timeout for a normal boot, but that seems to be overrridden in case of a system crash.

    I know I can edit my /etc/boot/grub/grub.cfg:
    Code:
    if [ "$recordfail}" = 1 ]; then
    
    set timeout=-1
    And set the timeout to something other than -1. But if I do that, would my changes be overwritten every time I update GRUB?

  4. #4
    Join Date
    Nov 2010
    Location
    Berlin, Germany
    Beans
    4,534
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: GRUB Automatic Boot After Crash

    It seems like modifying those part of "/etc/grub.d/00_header" would be the trick then:
    Code:
    cat << EOF
    if [ \${recordfail} = 1 ]; then
      set timeout=-1
    else
      set timeout=${GRUB_TIMEOUT}
    fi
    EOF
    But I guess those modification gets reverted when the package "grub-common" gets upgraded, however that seems not to happen too often.

    Greetings.
    Last edited by Krytarik; March 29th, 2011 at 06:16 PM.

  5. #5
    Join Date
    Feb 2010
    Beans
    11

    Re: GRUB Automatic Boot After Crash

    Quote Originally Posted by Krytarik View Post
    It seems like modifying those part of "/etc/grub.d/00_header" would be the trick then:
    Code:
    cat << EOF
    if [ \${recordfail} = 1 ]; then
      set timeout=-1
    else
      set timeout=${GRUB_TIMEOUT}
    fi
    EOF
    But I guess those modifications get reverted when the package "grub-common" gets upgraded, however that seems not to happen too often.

    Greetings.
    Awesome, that seems to do the trick. I'll just have to mess around with it. Thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •