choice of operating systems in GRUB

Asked by Danielle Brachel

on my computer i have both windows and ubuntu installed.
when i turn it on i get the boot loader screen and it asks which operating system i want to open,
and in a few seconds opens the first one that's highlightened (which is windows right now)
how can i make it so that the highlightened one would be ubuntu and so this would be the automatic choice?
thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
Shahar Or
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

andy@D420:/etc/grub.d$ ls
00_header 05_debian_theme 10_linux 20_linux_xen 20_memtest86+ 30_os-prober 40_custom 41_custom README

If you make the files in that folder be in that order, then run:

sudo update-grub

It will switch them around in the grub config. You will need to run:

gksudo gedit /etc/grub.d

Or you can use terminal, your choice. The number at the start of the filename dictates where it appears in the list

Revision history for this message
Danielle Brachel (d-brachel) said :
#2

i'm not sure i completely understand.. i ran "sudo update-grub" on the terminal, and then "gksudo gedit/etc/grub.d". is that what i was supposed to do?
when i turn on the computer it still shows windows first on the list, and after i choose ubuntu it opens another black screen which used to ask if i want to open the regular linux or recovery mode.. but now after i choose ubuntu it also shows on the list "previous linux versions"..
i'd love a detailed explenation, because i'm very new to linux and don't know much about computers :)
thank you!

Revision history for this message
Ubfan (ubfan1) said :
#3

The grub.cfg file contains the menu list you see at boot time, and normally, linux comes before Windows because the 10_linux is run before the 30_os-prober. If your files in /etc/grub.d had been renumbered to make windows first, then the number on the yy_os-prober must be lower than the xx_linux -- the fix is just to renumber them by renaming them with the mv command.
For example (use the numbers you see on your system)
sudo mv 06_os-prober 30_os-prober
(assuming the 10_linux file still is 10...)

The first os listed is normally the one highlighted, but that is controlled by the line
GRUB_DEFAULT=0
in the file /etc/default/grub

Rerun the sudo update-grub to use the new file order to rewrite the /boot/grub/grub.cfg file.

If your boot list does not match the order in your /boot/grub/grub.cfg file, then grub is using some other file, but you have not indicated you have multiple Linux installations, so that should not happen.
That gksudo gedit... looked like a a cut and paste error meant for some other issue, ignore it.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

The default doesn't respect when you install new kernels.

ALl you have to do is rename the files so it matches my names. If you can't do that then if you can give the output of:

ls /etc/grub.d

Then I can give commands to rename the files.

Revision history for this message
Best Shahar Or (mightyiam) said :
#5

Dear Danielle,

"when i turn on the computer it still shows windows first on the list, and after i choose ubuntu it opens another black screen which used to ask if i want to open the regular linux or recovery mode"

This sounds like Wubi, to me. An installation of Ubuntu "inside" of Windows. The first screen is Windows' boot loader and the second screen is Ubuntu's boot loader.

So as long as Ubuntu is installed like that, the default can be changed in Windows' boot loader configuration.

I recommend installing Ubuntu the proper way, no with Wubi. Wubi would be nice for... demonstration, perhaps.

Thanks and Blessings,

Shahar

Revision history for this message
Danielle Brachel (d-brachel) said :
#6

Thanks Shahar Or, that solved my question.