[SOLVED] Re-order The Grub Boot Menu?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

[SOLVED] Re-order The Grub Boot Menu?

Post by rgand » Sun Apr 03, 2016 12:14 pm

I have Mint Cinnamon 17.3 working on my machine and really like it. I also have Mate 17.3 on two older laptops that don't have the oomph to run Cinnamon.

My wife is still stuck on Win and is reluctant to try Mint yet. When I do install it for her, I'll do a dual boot so she can get used to Mint at her leisure. I know she'll be upset if it defaults to Mint and she wants the 'other OS', so...

Can the grub boot menu be re-written so on a dual boot machine the 'other OS' is the default boot and Mint is secondary?

Thanks for the help. RG
Last edited by rgand on Wed Jun 08, 2016 6:28 pm, edited 1 time in total.
Smile, it makes people wonder what you've been up to.

Laurent85
Level 15
Level 15
Posts: 5730
Joined: Tue May 26, 2015 10:11 am

Re: Re-order The Grub Boot Menu?

Post by Laurent85 » Sun Apr 03, 2016 12:54 pm

Edit grub defaults and set the save option, grub will offer to boot previous selection by default. Open a terminal:

Code: Select all

gksu gedit /etc/default/grub
Change GRUB_DEFAULT to saved

Code: Select all

GRUB_DEFAULT=saved
Append next line:

Code: Select all

GRUB_SAVEDEFAULT=true
Save & exit gedit.

Update grub:

Code: Select all

sudo update-grub
Image

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: Re-order The Grub Boot Menu?

Post by rgand » Sun Apr 03, 2016 1:07 pm

This is good. I'll copy it off and use it when I do the install. Many thanks.
Smile, it makes people wonder what you've been up to.

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: Re-order The Grub Boot Menu?

Post by rgand » Wed Jun 08, 2016 11:50 am

It took a whole to get to my wife's computer. I edited the file and updated the grub menu as suggested. The default boot still remained Mint. I have changed the file back to it's original condition and updated grub again. Here is a screen shot of the file before editing:
GrubDefault.jpg
What is needed to change this default?
Smile, it makes people wonder what you've been up to.

User avatar
jimallyn
Level 18
Level 18
Posts: 8469
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Re-order The Grub Boot Menu?

Post by jimallyn » Wed Jun 08, 2016 2:46 pm

Image

“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan

fabien85
Level 6
Level 6
Posts: 1392
Joined: Tue Mar 11, 2014 4:30 pm

Re: Re-order The Grub Boot Menu?

Post by fabien85 » Wed Jun 08, 2016 4:33 pm

Another possibility, if the rest fails, is to change

Code: Select all

GRUB_DEFAULT=0
which says that the default entry it will boot is the first one.
Typically your grub menu would be like :

Code: Select all

Linux Mint 17.3 ...
Linux Mint 17.3 ... (recovery mode)
Windows ...  

i.e. windows is the third entry. (Adapt if necessary). Then edit /etc/default/grub and change to

Code: Select all

GRUB_DEFAULT=2
save, exit and "sudo update-grub". Reboot and windows should boot by default after the countdown.

User avatar
Pjotr
Level 20
Level 20
Posts: 10987
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Re-order The Grub Boot Menu?

Post by Pjotr » Wed Jun 08, 2016 5:55 pm

This is an easy how-to:
https://sites.google.com/site/easylinux ... -boot-menu
(item 1, left column)
Tip: 10 things to do after installing Linux Mint 19 Tara
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: Re-order The Grub Boot Menu?

Post by rgand » Wed Jun 08, 2016 6:28 pm

Windows is the 5th choice on the menu so I changed the default to

Code: Select all

GRUB_DEFAULT=4
and it worked like a charm.

Thanks for all the quick responses and excellent help. This forum is the best.
Smile, it makes people wonder what you've been up to.

User avatar
Quexos
Level 2
Level 2
Posts: 72
Joined: Wed Jul 29, 2015 9:49 pm

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by Quexos » Wed Jun 08, 2016 7:22 pm

I always use the first method posted by Laurent85, but just an FYI in case you didn't catch on to this part...

Once you do the grub changes and reboot, you have to select "Other OS" and boot to it. After that rebooting will/should remain with "Other OS" selected and boot to it by "default", until you change it by selecting another and booting it, then that one would remain "default", etc. etc. It simply boots to the last one that was selected and booted. I love it that way so when I am using whatever OS, and reboot and walk away to get a drink, when I return it is back to the same desktop/OS without me having to wait around to select one, unless I intend to change it to the other.

I would add though, that you can also change the time before it auto boots to the "last used" OS to make it a bit faster for folks who rarely switch them, or slower for those who do but want more time to decide or finish digging through CDs, reading a chapter in a book, or whatever. Just modify this line while you're in grubs config file to 4 seconds or 90, or whatever:

GRUB_TIMEOUT=10

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by rgand » Wed Jun 08, 2016 9:31 pm

Thanks for that bit of input, Quexos. I missed that aspect completely. I'll remember that for the next time I need to set one up. My wife needs it simple and always the same but for my own uses, booting to the "last used" could come in handy.
Smile, it makes people wonder what you've been up to.

User avatar
Quexos
Level 2
Level 2
Posts: 72
Joined: Wed Jul 29, 2015 9:49 pm

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by Quexos » Sun Jun 19, 2016 4:59 pm

For her I would set it that way, change the timeout to 2-4 seconds and boot it once to her OS. From then on she can just boot, reboot as normal without touching the GRUB screen and there is not a long delay...just enough for you to change it when needed. Also if you hit one of the arrow keys during that 2-4 second count down, the count down stops and it will sit there and wait for you to decide and select the OS.

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by rgand » Sun Jun 19, 2016 6:56 pm

Quexos wrote:For her I would set it that way, change the timeout to 2-4 seconds and boot it once to her OS. From then on she can just boot, reboot as normal without touching the GRUB screen and there is not a long delay...just enough for you to change it when needed. Also if you hit one of the arrow keys during that 2-4 second count down, the count down stops and it will sit there and wait for you to decide and select the OS.
Also a good idea. For now, I'll leave it the other way but may do this eventually.
Smile, it makes people wonder what you've been up to.

Ayub Darma Bakti
Level 1
Level 1
Posts: 1
Joined: Mon Mar 20, 2017 12:39 am

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by Ayub Darma Bakti » Mon Mar 20, 2017 7:51 am

thx... very helping... :D :D :D :D :D :D

cogaritis
Level 1
Level 1
Posts: 18
Joined: Tue Mar 08, 2016 8:17 pm

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by cogaritis » Fri Sep 08, 2017 8:11 am

A screenshot of an updated /etc/default/grub file:
Selection_001.png

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by rgand » Fri Sep 08, 2017 10:40 am

I did my wife's menu to default to the 5th choice (GRUB_DEFAULT=4). It has been in use that way and she is pleased.

I also did my backup computer to boot to the last OS (GRUB_DEFAULT=saved) and like that a lot because I use it occasionally for presentations and I just boot to the OS I use for that beforehand and it comes up automatically.

The assistance in this thread has been extremely helpful. Thanks to all who have contributed. You're one very knowledgeable bunch. Image
Smile, it makes people wonder what you've been up to.

mint1248
Level 1
Level 1
Posts: 19
Joined: Sun Jun 25, 2017 9:20 am

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by mint1248 » Fri Oct 20, 2017 12:53 pm

Excellent!
I set the boot menu to boot to Windows 7 as default after 2 seconds.
Thanks!!

User avatar
rgand
Level 4
Level 4
Posts: 386
Joined: Fri Feb 05, 2016 12:44 am

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by rgand » Fri Oct 20, 2017 1:05 pm

Yeah, I've set all mine to 3 seconds and it's definitely better than 10. Also my main computer is set to default to one installation of Mint with the other installation of Mint available (my wife's is set that way too, only she needs Win 7 with Mint as the second choice) and my backup computer is set to boot to the last one chosen. I use that mostly on Win 7 but when I do a presentation, I want it to run Mint. Before I go, I boot to Mint and when I start it on location, it boots without any fiddling.
Smile, it makes people wonder what you've been up to.

xanizen
Level 1
Level 1
Posts: 21
Joined: Fri Apr 26, 2013 9:08 am

Re: Re-order The Grub Boot Menu?

Post by xanizen » Tue May 29, 2018 1:59 am

rgand wrote:
Wed Jun 08, 2016 6:28 pm
Windows is the 5th choice on the menu so I changed the default to

Code: Select all

GRUB_DEFAULT=4
and it worked like a charm.

Thanks for all the quick responses and excellent help. This forum is the best.
Does anyone know how I can get the 'current line' of the desired OS in grub, without having to restart the computer and take note of it, at run time?
Linux Mint 16 + Windows 7
AMD Phenom II 6-Core 2.8GHz
12GB G.Skill 1600MHz RAM
nVidia Geforce 760
Corsair Neutron 256GB SSD

fabien85
Level 6
Level 6
Posts: 1392
Joined: Tue Mar 11, 2014 4:30 pm

Re: [SOLVED] Re-order The Grub Boot Menu?

Post by fabien85 » Tue May 29, 2018 5:31 am

A pedestrian way is to read /boot/grub/grub.cfg and count the menu entries there until yours.
Pay attention that entries in the submenu 'Advanced options ..." do not count, you have to count the whole submenu as 1. And the entries are numbered 0,1,...,n-1
The following command may help you do this counting quicker :

Code: Select all

grep "menuentry " /boot/grub/grub.cfg
On my computer, all lines starting with a tab before "menuentry" belong to the submenu.

Post Reply

Return to “Installation & Boot”