LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-26-2007, 10:41 AM   #1
hiieu
LQ Newbie
 
Registered: Sep 2006
Posts: 14

Rep: Reputation: 0
Edit Grub to boot Windows


Hi,

I have dual OS Etch and Windows and I don't know how to edit Grub so it will boot Windows XP as a default for my family to use. Please
help.

Thank you,
 
Old 05-26-2007, 11:00 AM   #2
luis14
Member
 
Registered: Jun 2006
Location: Des Moines
Distribution: Debian Lenny
Posts: 59

Rep: Reputation: 15
http://www.linuxquestions.org/questi...d.php?t=280342

Last edited by luis14; 05-26-2007 at 11:06 AM.
 
Old 05-26-2007, 11:08 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
This may help also---basically you have to edit /boot/grub/menu.lst to include an entry for Windows.
 
Old 05-26-2007, 12:45 PM   #4
hiieu
LQ Newbie
 
Registered: Sep 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Thank you guys. My menu.list looks something like this

title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
boot

title Microsoft Windows XP Home
root (hd1,0)
savedefault
makeactive
chainloader +1


Luis14...that instruction will work on Sarge. I'm using Etch.


Pixellany...that instruction is out of my league. Is there an easy way to do this? Like in Sarge...you only change "Default" to 1 or 2 and done.
 
Old 05-26-2007, 01:46 PM   #5
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 53
Look for these lines in menu.lst:
Code:
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default         0
You would use 1 instead of 0 there as you have linux before windows in your menu.lst.

Last edited by makuyl; 05-26-2007 at 01:48 PM.
 
Old 05-26-2007, 01:54 PM   #6
luis14
Member
 
Registered: Jun 2006
Location: Des Moines
Distribution: Debian Lenny
Posts: 59

Rep: Reputation: 15
I would think grub is grub in sarge or etch.
I did what your trying to do, but it was a long time ago.
I think I just put the windows entry above the linux entry in menu.lst
Can you post a copy of your entire /boot/grub/menu.lst?
 
Old 05-26-2007, 03:56 PM   #7
r00ster
Member
 
Registered: May 2007
Location: boundary beach, bc
Distribution: Debian 3.2.46-1+deb7u1
Posts: 199

Rep: Reputation: 15
Quote:
Originally Posted by hiieu
Thank you guys. My menu.list looks something like this

title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
boot

title Microsoft Windows XP Home
root (hd1,0)
savedefault
makeactive
chainloader +1
Give this a try. If it still doesn't passively boot into XP (it *should*), try changing the order of appearance; i.e., list Windows first.

Quote:
title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
makeactive
chainloader +1

title Microsoft Windows XP Home
root (hd1,0)
savedefault
boot
Happy trails,

r00ster

Last edited by r00ster; 05-26-2007 at 03:58 PM.
 
Old 05-26-2007, 04:17 PM   #8
r00ster
Member
 
Registered: May 2007
Location: boundary beach, bc
Distribution: Debian 3.2.46-1+deb7u1
Posts: 199

Rep: Reputation: 15
Quote:
Originally Posted by hiieu
Thank you guys. My menu.list looks something like this

title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
boot

title Microsoft Windows XP Home
root (hd1,0)
savedefault
makeactive
chainloader +1
Give this a try. If it still doesn't passively boot into XP (it *should*), try changing the order of appearance; i.e., list Windows first.

Quote:
title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
makeactive
chainloader +1

title Microsoft Windows XP Home
root (hd1,0)
savedefault
boot
Once you get joy, it's good practice to cp your boot/grub/menu.lst to /boot/grub/menu.backup_lst. Reason being, when/if you upgrade your kernel, the windows stanza might get dropped. It happens.

Happy trails,

r00ster
 
Old 05-26-2007, 04:35 PM   #9
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 53
Don't put the chainloader +1 part under the linux stanza. Just change the default number 1 close to the beginning of menu.lst. An alternative would be to put 0 there and move the windows stanza before the linux one.
 
Old 05-26-2007, 05:58 PM   #10
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Seeing as Windows is installed on the second disk, it should be mapped also.
Is there something else on the first drive? or should you have (hd0,0) instead of (hd1,0)?. If Windows is on the first drive and first partition, it should be (hd0,0) for the root entry.

EDIT: The word "savedefault" should only be present in the entry you want to be the default.

Last edited by Junior Hacker; 05-26-2007 at 06:19 PM.
 
Old 05-27-2007, 04:41 AM   #11
r00ster
Member
 
Registered: May 2007
Location: boundary beach, bc
Distribution: Debian 3.2.46-1+deb7u1
Posts: 199

Rep: Reputation: 15
Quote:
Originally Posted by Junior Hacker
Seeing as Windows is installed on the second disk, it should be mapped also.
Is there something else on the first drive? or should you have (hd0,0) instead of (hd1,0)?. If Windows is on the first drive and first partition, it should be (hd0,0) for the root entry.

EDIT: The word "savedefault" should only be present in the entry you want to be the default.
FWIW, I have an OEM Windows XP chainloaded on a slave drive and Etch installed on the master HD. My boot/grub is quoted below.

If it is desired that Windows boot passively on restarts, it would make some sense to configure (jumper) the HDs with Windows HD as master and Debian as slave. Whichever approach you decide upon,I trust you can configure the mapping appropriate to your needs from the following. It took me several attempts to get it just right, but it works perfectly for me.

Quote:
## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.18-4-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-4-686 root=/dev/hda1 ro installgui install
standard"
initrd /boot/initrd.img-2.6.18-4-686
savedefault

title Debian GNU/Linux, kernel 2.6.18-4-686 (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-4-686 root=/dev/hda1 ro installgui install
standard" single
initrd /boot/initrd.img-2.6.18-4-686
savedefault

title Windows XP
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

### END DEBIAN AUTOMAGIC KERNELS LIST

#If windows boot stanza gets lost during upgrade, use:
#title Windows XP
# rootnoverify (hd1,0)
# map (hd0) (hd1)
# map (hd1) (hd0)
# chainloader +1

One issue you might encounter is (re)setting the computer clock times. When in Windows, I find the clock has auto set to GMT. If I correct it to my zone, the next boot into Linux (KDE) results in a wonky time/date setting and I need to reset it. I now leave the clock alone in Windows since nothing I do there is time sensitive. This prevents the 'wonk' when rebooting into Linux.

Happy trails,

r00ster
 
  


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
Kind souls: help getting Mandriva install 2 boot? edit boot.ini/grub /boot device or NoMoreReinstallMS Linux - Newbie 1 08-09-2006 04:34 AM
Edit the grub config from windows? critical Linux - Software 5 04-13-2006 08:43 AM
Using grub to boot.. How do I edit to get mandrake to boot? rrfish72 Linux - General 3 10-29-2004 02:00 AM
How do I edit the grub boot in SuSE Linux trespasser Linux - Newbie 3 04-12-2004 12:58 PM
edit Red Hat 9 Grub to boot Windows southsibling Linux - Software 3 12-18-2003 08:03 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration