Results 1 to 4 of 4

Thread: Gnu Grub to boot last used os

  1. #1
    Join Date
    Jan 2012
    Beans
    3

    Gnu Grub to boot last used os

    Hello, i have been using ubuntu for a few months now, and it has been hard learning things on my own, i like to code some in windows, mostly for fun.

    One thing i would like is to modify the settings in gnu grub to boot the last used os, can anyone help me? I tried to read the manual, but lets just say it's big, very big, and the few instructions i found related to what i wanted turned out useless.

  2. #2
    Join Date
    Jul 2011
    Location
    Germany
    Beans
    990
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Gnu Grub to boot last used os

    Quote Originally Posted by pigmentty View Post
    Hello, i have been using ubuntu for a few months now, and it has been hard learning things on my own, i like to code some in windows, mostly for fun.

    One thing i would like is to modify the settings in gnu grub to boot the last used os, can anyone help me? I tried to read the manual, but lets just say it's big, very big, and the few instructions i found related to what i wanted turned out useless.
    as far as i know there is no option to boot the "last used" os. But i can show you how to edit the grub configuration file on what the default OS is to be booted. Important here is how many grub entries you have, by default it should look like this for a normal dualboot:
    Code:
    Linux headers
    Linux headers (recovery)
    Memtest
    Memtest 86
    /dev/sda Windows
    making it a total of 5 entries, starting at 0. Thus the last entry, in this example windows, would have the entry number 4. Now once we are booted into ubuntu you can open a terminal and type
    Code:
    gksu gedit /etc/default/grub
    to open the configuration file. There you edit the line that says
    Code:
    GRUB_Default=0
    there you change the number to the entry number of which OS you would like to boot by default (change it to 4 if you want windows like shown in the example). You can also edit the line
    Code:
    GRUB_TIMEOUT=10
    on how many seconds the Grub bootloader is supposed to "wait" for input before loading the default OS.

    After you are done with the changes, save the settings.

    type the command in the terminal
    Code:
    sudo update-grub
    for the changes to take effect.

    done




    regards
    i5 2500k @ 4.4 GHz | MSI Z68A-GD65 (G3) | Gigabyte GTX 570 (OC) 1280 MB GDDR5 | Alpenföhn Himalaya | Corsair Vengeance 1600MHz 8GB CL9 RAM | Be quiet! Straight Power BQT-E9 700W | NZXT Lexa S | Monitor - ASUS ML248H 24"

  3. #3
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Gnu Grub to boot last used os

    Ubuntu uses Grub 2, so this should work for you: https://wiki.archlinux.org/index.php...previous_entry
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  4. #4
    Join Date
    Apr 2005
    Location
    Finland/UK
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Gnu Grub to boot last used os

    Edit /etc/default/grub, and set the GRUB_DEFAULT to "saved" and GRUB_SAVEDEFAULT to "true". Save the file and run "sudo update-grub". It will now always default to the last used option.

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
  •