Boot order in Ubuntu 10 and Win 7

Nils Kassube kassube at gmx.net
Fri Jan 21 08:53:42 UTC 2011


Oliver Marshall wrote:
> I have a laptop with win7 and ubuntu 10 on it. After installing
> Ubuntu 10 the default boot option became Ubuntu rather than Windows.
> 
> Is there an easy way to change the default boot option back to Win7 ?

According to [1] it should work like this:

First locate the menu entry for Windows in the boot loader configuration
file with the command

grep ^menuentry /boot/grub/grub.cfg

in a terminal. There should be several lines and probably the last one
is for Windows. As I don't have Windows 7 I can only explain it with an
entry for Ubuntu. If the appropriate line is

menuentry 'Ubuntu, mit Linux 2.6.32-27-generic' --class ubuntu --class gnu-linux --class gnu --class os {

then the part between the single quotes would be needed for the second
step, i.e. here it would be

Ubuntu, mit Linux 2.6.32-27-generic

Now edit the grub config default file with the command

gksu gedit /etc/default/grub

Locate the entry for GRUB_DEFAULT and make it

GRUB_DEFAULT="Ubuntu, mit Linux 2.6.32-27-generic"

where the part between the double quotes is the exact menu entry from
the first step - of course you would use your Windows entry.

Finally run the command

sudo update-grub

and reboot to check if it works as desired.


Nils

[1] <https://help.ubuntu.com/community/Grub2#/etc/default/grub%20(file)>




More information about the ubuntu-users mailing list