LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2011, 05:29 PM   #1
LittlePenguin
Member
 
Registered: Jan 2011
Posts: 52

Rep: Reputation: 3
How to chance my boot order in GRUB?


I wanna change the boot order, right now Linux starts first, and I wanna configure GRUB to make Windows start first, how can I do this?

Thx!
 
Old 05-12-2011, 05:56 PM   #2
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Tell us which version of Linux you have
 
Old 05-12-2011, 05:56 PM   #3
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Which grub are you using?
If grub2:
http://www.dedoimedo.com/computers/g...mozTocId463716
 
Old 05-12-2011, 06:19 PM   #4
LittlePenguin
Member
 
Registered: Jan 2011
Posts: 52

Original Poster
Rep: Reputation: 3
Im using Debian Squeeze.
 
Old 05-12-2011, 06:22 PM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Grub2 should be your bootloader unless you chose legacy.
 
Old 05-12-2011, 09:10 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,818

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
from the very very little amount of information
set the default in the grub.conf( menu.lis) to "other" or the "windows " or " whatever you called it"

it is there near the top of the file
the first on the list is 0
 
Old 05-12-2011, 09:51 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,156

Rep: Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204
Grub is actually a fairly "sensible" program ... it knows how to read files.

Look for the file /boot/grub/grub.conf ... or something like that.

But before you do that, surf the online documentation for Grub.
 
Old 05-12-2011, 10:56 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Setting default per Grub manual for Grub2, if Debian is using that??

http://www.gnu.org/software/grub/man...b.html#default

There's also a set default line near the top of the grub.cfg file. Seems to start its count of menuentry items at zero.
If you have Grub Legacy, you will have a menu.lst file which, as indicated by several members above, has a default entry at the top.
 
Old 05-13-2011, 02:03 AM   #9
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
If you use grub2, do NOT edit any files in the /boot directory; one of the changes from grub legacy is that those files now get overwritten during kernel updates.

If you use grub2, you should edit /etc/default/grub (look for GRUB_DEFAULT and replace 0 with the exact windows entry as it appears on your grub menu e.g. "windows XP (on /dev/sda1))and then save your changes and run update-grub to have the edits propagated to the grub files in the /boot directory.

Last edited by jay73; 05-13-2011 at 02:13 AM.
 
Old 05-15-2011, 11:26 AM   #10
LittlePenguin
Member
 
Registered: Jan 2011
Posts: 52

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by jay73 View Post
If you use grub2, do NOT edit any files in the /boot directory; one of the changes from grub legacy is that those files now get overwritten during kernel updates.

If you use grub2, you should edit /etc/default/grub (look for GRUB_DEFAULT and replace 0 with the exact windows entry as it appears on your grub menu e.g. "windows XP (on /dev/sda1))and then save your changes and run update-grub to have the edits propagated to the grub files in the /boot directory.
I got this in my /etc/default/grub:

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

How should I have to modify it exactly?, cuz I cant find anything inside /dev/sda1, the file is empty.

Thx.
 
Old 05-15-2011, 03:16 PM   #11
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Open your /boot/grub/grub.cfg file. Count down to the windows entry and put that number in the /etc/default/grub file. The entries count from zero so if windows is the third entry you would change the GRUB_DEFAULT= to 2.
 
Old 05-15-2011, 11:33 PM   #12
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
I think the trouble with using numbers is they tend to get messed up by kernel updates: what is 2 before tends to become 4 after.

Quote:
How should I have to modify it exactly?, cuz I cant find anything inside /dev/sda1, the file is empty.
Have a look at /boot/grub/grub.cfg; the entry should be near the bottom and will look something like this:

menuentry "Windows XP Professional Edition (on /dev/sdb1)"

Remove "menuentry" and copy the rest of the line as the value of "GRUB_DEFAULT=" in /etc/default/grub. Don't forget to run sudo update-grub after doing that or your edit won't be written to the boot menu.
 
Old 05-16-2011, 09:13 AM   #13
LittlePenguin
Member
 
Registered: Jan 2011
Posts: 52

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by yancek View Post
Open your /boot/grub/grub.cfg file. Count down to the windows entry and put that number in the /etc/default/grub file. The entries count from zero so if windows is the third entry you would change the GRUB_DEFAULT= to 2.
Thx, worked like a charm


@jay73 thx, but too complicated
 
Old 05-16-2011, 09:33 AM   #14
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,156

Rep: Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204Reputation: 2204
Naturally, it's always a good idea to save a complete backup of all things relating to Grub, and /boot.

You should also, of course, have a recently-tested copy of a Linux distro that can boot stand-alone from CD or DVD, and you should be familiar with how to use it. (Stage a "fire drill" for yourself, every now and then.)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub question changing boot order making windows boot first nfsutim Linux - Newbie 29 10-27-2012 01:53 PM
Grub boot order Sunfist Linux - Newbie 3 05-04-2008 12:04 PM
GrUB boot order Tonygat105 Linux - Newbie 2 11-17-2007 02:22 PM
grub boot order rsaar Linux - Newbie 4 02-26-2004 11:23 AM
grub boot order zeky Linux - General 3 12-11-2002 07:27 AM


All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration