reorder GRUB to list Windows on top
Solution 1
If the order of your boot menu is important (and not just that Windows boots by default), and you don't have anything bootable besides Linux Mint and Windows (like OSX, BSD) you can do:
cd /etc/grub.d
mv 30_os-prober 09_os-prober
as the alphabetical order of the files in /etc/grub.d
, determines in what order they are processed. Then you run sudo update-grub
¹ to generate the /boot/grub/grub.cfg
file, which determines the menu ordering.
If you just want to have Windows boot you can also change /etc/default/grub
and change the entry
GRUB_DEFAULT=0
to
GRUB_DEFAULT=4
and run sudo update-grub
. 4
is the normal entry for Windows after 0
for Mint, 1
for the submenu with older versions of Mint, 2
for memcheck
and 3
for memcheck
via a serial interface. Your setup might be slightly different, but you can count (starting from 0) while in the grub menu, or just try and change if your guestimate is off.²
There is third alternative you might want to consider, and which I myself prefer. This is to to change your /etc/default/grub
so that it will automatically boot the system you last selected, if you don't select a different menu entry by hand. For that you change the line
GRUB_DEFAULT=0
into
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
and run sudo update-grub
¹ I tended to forget the name of the update-grub
command often trying grub-
TAB and hope the resulting expansions showed me the grub-something
command I needed to run. That was until I realised that it says what to do at the top of /etc/default/grub
file I was editing anyway. Of course once I found out how to look the command name up, I never forgot....
² As @derobert indicated, you can also use a string that matches the menu entry you want to select. This is the only documentation I have found about that feature.
Solution 2
From the answer by Anthon, I'd replace the mv
with dpkg-divert
on Debian-like systems:
# dpkg-divert --add --rename --divert /etc/grub.d/09_os-prober /etc/grub.d/30_os-prober
Then run update-grub
as usual.
If you wish to list the available diversions, then run:
# dpkg-divert --list | grep os-prober
Related videos on Youtube
sunbabaphu
Updated on September 18, 2022Comments
-
sunbabaphu over 1 year
I have win 7 and linux mint 14 installed. Is it possible to modify the
GRUB Menu
to showWindows
as the first option instead ofLinux
, which it currently does. Mainly so that during boot it starts Windows by default.-
beginer almost 10 yearsGosh...linux 14?? When did it get released, moreover when was linux-13 released? moreover.... :D I guess you mean Ubuntu 14.
-
sunbabaphu almost 10 yearslinuxmint.com/rel_nadia_whatsnew.php Linux 14 => Linux mint 14
-
beginer almost 10 yearsAnthon Earlier in the question it was mentioned Linux 14 , which made me wonder when did Linux kernel version 14 get released.
-
Anthon almost 10 years@beginer sorry I missed that edit.
-
beginer almost 10 years@Anthon hah :D cheers man....
-
-
derobert almost 10 yearsNote that GRUB_DEFAULT can be a string as well, the full title of the menu entry. This will be much more robust than presuming Windows is always option #4.
-
Anthon almost 10 years@derobert that is good to know. The robustness of did vastly increase some time ago (at least on Ubuntu) when the sub-menus were used to stow the 'old' kernels, but explicit is better. The non-robustness of hard-coding was one of the reasons for me to use
GRUB_SAVEDEFAULT
-
sunbabaphu over 9 yearsThanks! i tried only the second option, and it worked!.. just one thing: i used
sudo update-grub
instead ofsudo update=grub
... i dont know if both will work. -
Anthon over 9 years@sunbabaphu update=grub was a typo, I corrected it, thanks for pointing it out.