LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-10-2007, 07:02 PM   #1
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Rep: Reputation: 0
Need help getting the bootloader to default to XP


Hi,

I've got 2 internal drives on my Dell - one has XP and one has Unbuntu. Presently when I power up I get the bootloader screen offering me various flavors of Unbuntu and at the bottom of the list - Windows XP. If I don't catch it in time in automatically boots to Unbuntu. I think this is because U comes before W in the alphabet.

Is there a way to get it to boot to XP instead by default instead? I've looked at other posts regarding this- but I'm not sure where a grub file lives - on the HD with windows or the HD with Unbuntu? I thought this bootloader was in the BIOS file anyways.

Thanks.
 
Old 07-10-2007, 07:38 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,971
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
The grub configuration file is in Ubuntu. The file is: /etc/grub/menu.lst

Open a terminal and vi the file:
Code:
vi /etc/grub/menu.lst
Where it says "default" change that number...Not sure....Windows is usually 1 so change it from a 2 to a 1. Also you can change the timeout to make it longer.

Bootloader is installed in the MBR on the HD. The BIOS is not a file...it's a chip

-custangro
 
Old 07-10-2007, 08:26 PM   #3
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Original Poster
Rep: Reputation: 0
uh oh - now i get this

E325: ATTENTION
Found a swap file by the name "/var/tmp/menu.lst.swp"
owned by: ted dated: Tue Jul 10 17:21:09 2007
file name: /etc/grub/menu.lst
modified: YES
user name: ted host name: ted-linux
process ID: 5773
While opening file "/etc/grub/menu.lst"

(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.

(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/grub/menu.lst"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/var/tmp/menu.lst.swp"
to avoid this message.

"/etc/grub/menu.lst" [New DIRECTORY]
Press ENTER or type command to continue
 
Old 07-10-2007, 10:54 PM   #4
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Original Poster
Rep: Reputation: 0
ted@ted-linux:~$ /boot/grub/menu.lst
bash: /boot/grub/menu.lst: Permission denied
ted@ted-linux:~$ /boot/grub/grub.conf
bash: /boot/grub/grub.conf: No such file or directory
 
Old 07-11-2007, 09:22 AM   #5
pplude92
LQ Newbie
 
Registered: Jul 2007
Distribution: Debain 4.0 "Etch"
Posts: 15

Rep: Reputation: 0
You need to become root. Try running it with sudo. The command is:

Code:
sudo [editor-see below] /boot/grub/menu.list
Ubuntu uses "gedit"
Kubuntu uses "kate" or "kwrite"
Xubuntu uses "mousepad"

The grub conf file is generally unused, and sometimes uninstalled. The menu.list is very well explained at the beginning of the file when you open it.

Hope that helps!

Last edited by pplude92; 07-11-2007 at 09:24 AM.
 
Old 07-11-2007, 09:29 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by tedblais
ted@ted-linux:~$ /boot/grub/menu.lst
bash: /boot/grub/menu.lst: Permission denied
ted@ted-linux:~$ /boot/grub/grub.conf
bash: /boot/grub/grub.conf: No such file or directory
Here, you were trying to execute those files.....You want to edit them.

The link below (booting...) may also be useful.
 
Old 07-11-2007, 10:58 AM   #7
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,971
Blog Entries: 1

Rep: Reputation: 208Reputation: 208Reputation: 208
pplude92 is right. You need to edit the file with a text editor...since you are not to savvy with vi I recommend gedit:

Code:
sudo gedit /boot/grub/menu.list
Save the file and you should be good...
 
Old 07-11-2007, 12:52 PM   #8
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Original Poster
Rep: Reputation: 0
getting closer

ok - im getting somewhere.

here is the code from the menu.lst file:

Code:
title		Ubuntu, kernel 2.6.20-16-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-16-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro quiet splash
initrd		/boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title		Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-16-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro single
initrd		/boot/initrd.img-2.6.20-16-generic

title		Ubuntu, kernel 2.6.20-15-generic
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro quiet splash
initrd		/boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title		Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root		(hd1,0)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro single
initrd		/boot/initrd.img-2.6.20-15-generic

title		Ubuntu, memtest86+
root		(hd1,0)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1

i still am unsure what to change.
 
Old 07-11-2007, 01:12 PM   #9
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Windows Boot first.

You can cut and paste the windows entry at the top (example)or you can set default to 5.

Example:

### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

title Ubuntu, kernel 2.6.20-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, kernel 2.6.20-15-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro single
initrd /boot/initrd.img-2.6.20-15-generic

title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet
 
Old 07-11-2007, 04:15 PM   #10
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Original Poster
Rep: Reputation: 0
set default to 5?

Can you tell me where?

There are 3 places where it says "save default" in this code.
 
Old 07-11-2007, 05:17 PM   #11
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Sorry, lil more info.

add:
grub-set-default 5
before:

title Ubuntu, kernel 2.6.20-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, kernel 2.6.20-15-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=12860e84-fb74-4634-b694-fe241d7b231f ro single
initrd /boot/initrd.img-2.6.20-15-generic

title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
 
Old 07-11-2007, 05:52 PM   #12
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Hi,

Well that sort of worked.

The "grub-set-default 5" didn't do anything. So I did the cut and paste method. Now when it comes up it highlights the text:

"Other Operating Systems"

Which of course is not an operating system, just a line of text and I get "Invalid (something or other), press any key"

Microsoft Windows XP Professional is the next line underneath - thats the one I am trying to highlight!

Im on the right path though..........
 
Old 07-11-2007, 06:46 PM   #13
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Oops.

I should be more careful on cut and paste hehe. sorry... just delete title Other operating systems:or put a # in from of that line and the root line i believe.
 
Old 07-12-2007, 07:48 AM   #14
UK MAdMaN
Member
 
Registered: Jul 2004
Location: Manchester, England
Distribution: Gentoo
Posts: 211

Rep: Reputation: 30
Or you can just change the 5 to a 6 if you want to keep the "Other..." line.

It works by counting the number of Title lines (with the first line being 0 not 1, so for the 4th line you'd use 3).
 
Old 07-13-2007, 03:17 PM   #15
tedblais
LQ Newbie
 
Registered: Jun 2007
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks!

Quote:
Originally Posted by Hern_28
I should be more careful on cut and paste hehe. sorry... just delete title Other operating systems:or put a # in from of that line and the root line i believe.
That worked!
 
  


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
change default OS to boot from grub bootloader. trempel Ubuntu 5 05-27-2005 09:20 PM
Default Bootloader Options in MDK10 Panik-Linux Mandriva 1 08-17-2004 05:05 PM
how to change the default OS in the bootloader? lightnb Linux - Software 2 07-22-2004 09:54 PM
Default bootloader? Locura *BSD 4 09-12-2003 07:51 AM
how to change default O/S in bootloader nthowl Linux - General 1 10-16-2002 02:17 AM


All times are GMT -5. The time now is 02:21 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