Results 1 to 7 of 7

Thread: How to keep grub from hanging on the menu

  1. #1
    Join Date
    Dec 2009
    Location
    Thailand
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Red face How to keep grub from hanging on the menu

    Ubuntu 12.04 Server. Normal boot goes OK. But if something bad happens, like a power failure, grub hangs on the grub menu waiting for somebody to press Enter on the console.

    This is an unattended server system; there will be no one on the console. There may not even be a console.

    I found one kludge: replace /boot/grub/grubenv with an unreadable unwritable unsearchable directory. That way whoever is setting "recordfail=1" can not. But any other grub feature that depends on grubenv will also fail. I can't find any option anywhere that tells grub "Do not wait on the menu under any circumstances".

  2. #2
    Join Date
    Dec 2008
    Location
    43° 7' 41" 131° 54' 3"
    Beans
    Hidden!

    Re: How to keep grub from hanging on the menu

    Last edited by jtarin; May 13th, 2012 at 10:28 AM.
    EasyBCD.
    PrintersDatabase
    Boot Info Script: How to
    The post above and the post below suffer from the Rashomon effect!

  3. #3
    Join Date
    Dec 2009
    Location
    Thailand
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Wink Re: How to keep grub from hanging on the menu

    Great! FYI Ubuntu 12.04 (grub 1.99) has a file /etc/grub.d/00_header and in there is a function that reads:
    Code:
    make_timeout ()
    {
        cat << EOF
    if [ "\${recordfail}" = 1 ]; then
      set timeout=-1
    else
      set timeout=${2}
    fi
    EOF
    }
    I changed that to:
    Code:
    make_timeout ()
    {
        cat << EOF
      set timeout=0
    EOF
    }\
    and re-ran grub-mkconfig and now it works. Thanks!

  4. #4
    Join Date
    Dec 2008
    Location
    43° 7' 41" 131° 54' 3"
    Beans
    Hidden!

    Re: How to keep grub from hanging on the menu

    FYI that configuration is in the second link I posted.
    EasyBCD.
    PrintersDatabase
    Boot Info Script: How to
    The post above and the post below suffer from the Rashomon effect!

  5. #5
    Join Date
    Dec 2009
    Location
    Thailand
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: How to keep grub from hanging on the menu

    Quote Originally Posted by jtarin View Post
    FYI that configuration is in the second link I posted.
    It certainly is. And there's a good chance that the solution shown in that link is better than my solution, because it will show the menu without hanging on it, whereas my 'fix' just bypasses the menu. I don't know why I missed that when I first saw your post. Please pardon me.

  6. #6
    Join Date
    Dec 2008
    Location
    43° 7' 41" 131° 54' 3"
    Beans
    Hidden!

    Re: How to keep grub from hanging on the menu

    Quote Originally Posted by AndyCanfield View Post
    It certainly is. And there's a good chance that the solution shown in that link is better than my solution, because it will show the menu without hanging on it, whereas my 'fix' just bypasses the menu. I don't know why I missed that when I first saw your post. Please pardon me.
    No problem. I do it frequently.
    EasyBCD.
    PrintersDatabase
    Boot Info Script: How to
    The post above and the post below suffer from the Rashomon effect!

  7. #7
    Join Date
    Dec 2004
    Beans
    11

    Re: How to keep grub from hanging on the menu

    Here's a tip from the bug that says it will be backported to 12.04:
    https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/669481/comments/13

    Code:
    echo GRUB_RECORDFAIL_TIMEOUT=0 | sudo tee -a /etc/default/grub
    sudo update-grub

Tags for this Thread

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
  •