Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: update-grub command encounters an error

  1. #1
    Join Date
    Jun 2013
    Beans
    6

    update-grub command encounters an error

    I'm new to Ubuntu, only installed it yesterday, and I'm running it alongside Windows 7. The version I have installed is Ubuntu 13.04. I've been trying to edit the grub settings, so that it has a 5 second hidden timer in which I can press any key to open the grub menu, after which it will automatically boot Windows 7 if no key is pressed. I'm fairly sure that I've set the file /etc/default/grub correctly for these settings, but I'll post it here anyway, in case it's part of the problem.

    # If you change this file, run 'update-grub' afterwards to update
    # /boot/grub/grub.cfg.
    # For full documentation of the options in this file, see:
    # info -f grub -n 'Simple configuration'


    GRUB_DEFAULT=4
    GRUB_HIDDEN_TIMEOUT=5
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=0
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX=""


    # Uncomment to enable BadRAM filtering, modify to suit your needs
    # This works with Linux (no patch required) and with any kernel that obtains
    # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
    #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xe fefefef"


    # Uncomment to disable graphical terminal (grub-pc only)
    #GRUB_TERMINAL=console


    # The resolution used on graphical terminal
    # note that you can use only modes which your graphic card supports via VBE
    # you can see them in real GRUB with the command `vbeinfo'
    #GRUB_GFXMODE=640x480


    # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
    #GRUB_DISABLE_LINUX_UUID=true


    # Uncomment to disable generation of recovery mode menu entries
    #GRUB_DISABLE_RECOVERY="true"


    # Uncomment to get a beep at grub start
    #GRUB_INIT_TUNE="480 440 1"
    I then tried to run update-grub in the terminal, but every time I try, I get the same result:

    asadderandawiserman@joseph-AMILO-Li3910:~$ sudo update-grub
    [sudo] password for asadderandawiserman:
    /usr/sbin/grub-mkconfig: 1: /etc/default/grub: #: not found

    It seems that this has not updated the grub effectively, because when I restart, it works exactly like it always has. I've had a look, but couldn't find any relavent threads, so I was wondering if anyone knew how to fix this?

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: update-grub command encounters an error

    Have you somehow changed the name of the /etc/default/grub file or changed its permissions?

    What's the output of...
    Code:
    ls -lha /etc/default/grub
    Cheesemill

  3. #3
    Join Date
    Jun 2013
    Beans
    6

    Re: update-grub command encounters an error

    Quote Originally Posted by Cheesemill View Post
    Have you somehow changed the name of the /etc/default/grub file or changed its permissions?

    What's the output of...
    Code:
    ls -lha /etc/default/grub
    I haven't changed the name, but I did make myself the owner so that I could edit the file, before changing the ownership back to root. The output is:

    Code:
    -rw-r--r-- 1 root root 1.3K Jun 14 09:16 /etc/default/grub

  4. #4
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: update-grub command encounters an error

    If it is back to root it should then work.

    Better just to edit this way:
    sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
    gksudo gedit /etc/default/grub
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Jun 2013
    Beans
    6

    Re: update-grub command encounters an error

    Quote Originally Posted by oldfred View Post
    If it is back to root it should then work.

    Better just to edit this way:
    sudo cp -a /boot/grub/grub.cfg /boot/grub/grub.cfg.backup
    gksudo gedit /etc/default/grub
    In future, I'll use that method to edit files, but although I've changed the ownership to root, update-grub still reacts the exact same way I mentioned in the first post. Is there any other reason it could be acting like this?

  6. #6
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: update-grub command encounters an error

    Show the results again

    Code:
    sudo grub-mkconfig -o /boot/grub/grub.cfg.new

  7. #7
    Join Date
    Jun 2013
    Beans
    6

    Re: update-grub command encounters an error

    Quote Originally Posted by NikTh View Post
    Show the results again

    Code:
    sudo grub-mkconfig -o /boot/grub/grub.cfg.new
    Code:
    /usr/sbin/grub-mkconfig: 1: /etc/default/grub: #: not found
    This is what I got.

  8. #8
    Join Date
    Mar 2008
    Location
    Missouri, USA
    Beans
    93
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: update-grub command encounters an error

    As a last resort I believe you can reinstall grub on the had drive that you boot from although you may lose any changes you made.
    For me it was 'grub-install /dev/sdb' since I boot from the 2nd sata drive.
    Please read 'man grub-install' before trying this.
    I would follow oldfred's advice in the future when changing important files.

    Take care.

  9. #9
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: update-grub command encounters an error

    I do not see what is wrong, but sometimes the only fix is a reinstall. You only need to totally uninstall grub2 and reinstall it.

    I might delete that file also before reinstalling if the uninstall does not work.

    If you can boot, you can skip the chroot part.

    chroot & grub uninstall & reinstall -drs305
    http://ubuntuforums.org/showthread.php?t=1581099


    Boot-Repair also has a helper to chroot & uninstall and reinstall.
    While grub is uninstalled you will not be able to reboot, so make sure you have reinstalled before rebooting.


    # uninstall both grub legacy & grub2 reinstall grub2 and to sda
    sudo -i
    apt-get purge grub grub-pc grub-common
    mv /boot/grub /boot/grub_backup
    mkdir /boot/grub
    apt-get install grub-pc grub-common
    grub-install /dev/sda
    grub-install --recheck /dev/sda
    update-grub
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  10. #10
    Join Date
    Jun 2013
    Beans
    6

    Re: update-grub command encounters an error

    Thanks very much all of you, I got the update-grub to work, but it still doesn't seem to work properly. I set up the grub file in the same way I showed in the first post, then ran update-grub and restarted the computer, but it didn't work quite as I intended. As I explained in the original post, I wanted a 5 second hidden timer, then to load the default OS, Windows 7. What has actually happened, is when I turn on the computer, it flashes up 'Loading GRUB' for a fraction of a second, then there is a flash of GRUB-purple, before the computer boots Windows 7 normally. There doesn't seem to be a way to get to the GRUB menu, or to access the Ubuntu OS at all. So I have two problems:

    1. What did I do wrong in the settings for grub which caused it to behave in this way and how can I fix it?

    2. Is there any way I can access Ubuntu, because at the moment, my computer will only boot as described above, so I can only access windows 7.

    Thanks!

Page 1 of 2 12 LastLast

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
  •