Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Making changes to Grub

  Date: Dec 03    Category: Unix / Linux / Ubuntu    Views: 575
  

I have gotten 10.04, on my Laptop in dual boot. It works great, however
I would like to change the boot order, so Windows boots by default instead
of the Ubuntu. Roy has said the /boot/grub/grub.cfg file should be edited.
However that file says it should not be edited. In doing a Google search
on changing Grub2 it looks like there are other files to edit to make these
changes. In reading this it looks a little like our HP Unix init directory
structure
we had back in the late 1990's. But has anyone done this and might be able
to give me a short cut in a directory/file name to edit to change this boot
order
only.

Share: 

 

6 Answers Found

 
Answer #1    Answered On: Dec 03    

take a look at the grub 2 guide on ubuntu forums... It is fairly detailed.

http://ubuntuforums.org/showthread.php?t=1195275

But basically (if I remember right), look at the OS listings in menulist and
count them starting at 0. in /etc/default/grub find the line that says
GRUB_DEFAULT=0, and change the number to the OS you want. then run sudo
update-grub

if you change the value from "0" (zero) to "saved", you can also select the
default by doing sudo grub-set-default X where "X"= either the # or the
exact string of the menulisting for the os you want to boot. You'll need to
enclose the string in quotes if you go that route.

Hope that helps

btw, your last post reminded me of that video of the kid who points at
specific places on a US map then dances around while her dad sings
"smarty-pants dance smarty-pance dance"... that is now stuck in my head.

 
Answer #2    Answered On: Dec 03    

I did get it to work after a while. It is straight forward, so I was
quite preplexed when it couldn't get it to work tonight. So I went
to the store and picked up some bannas for tomorrow breakfast,
and had a flat forhead moment while at the store.

In Unix(Linux) you count from 0 not 1, ding ding ding, so I got home
and changed the DEFAULT to 4 not 5 as I had it.

 
Answer #3    Answered On: Dec 03    

I should have mentioned that. Grub uses ordinal numbers.

 
Answer #4    Answered On: Dec 03    

That is a disclaimer in order to get people to use the proper protocols
which are fine if it writes what you want and where you want it. If it
doesn't then you have to take matters into your own hands. Yes, you should
use upgrade-grub, but that is no use if it is writing what you don't want. I
have had to edit grub.cfg a number of times. I have had to do it in Fedora
12 in order to get the proprietary nVidia driver to work with Plymouth and
when I have installed some distros that write grub incorrectly. It is your
decision.

It is just a text file. You need to edit it as root. Use sudo gedit from a
terminal to do this. If you cut and paste the Windows section and move it to
the top then it will boot into Windows first. Or you can change the zero in
set default="0" to the number in the list of OSes that corresponds to
Windows. For me cut and paste is easier than counting OSes and getting that
right.

If you can figure out how to change the default without manually editing
grub.cfg, please post it.

 
Answer #5    Answered On: Dec 03    

does changing

GRUB_DEFAULT=saved (in /etc/default/grub) and

sudo grub-set-default "Ubuntu, Linux 2.6.xx.xx-x-generic" (or whatever the
OS is you want to be default)

not do the job?

But really, the only reason I could think of to not edit it manually would
be to safegard a casual/new user against running update-grub for some reason
and overwriting all of their changes. I also seem to remember reading if
you remove an old kernel in Ubuntu with synapic that the update-grub command
is run automatically... Don't know if that is true or not... Has anyone
tried it?

 
Answer #6    Answered On: Dec 03    

You can also install from Synaptic the "startupmanager", a very easy to use
tool.

 
Didn't find what you were looking for? Find more on Making changes to Grub Or get search suggestion and latest updates.




Tagged: