LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 04-20-2006, 10:26 PM   #1
statictiger
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
Writing a Dual Boot System in Grub


A friend of mine is currently using Linux, but not Windows. He is about to get a new hard drive and is going to put Windows XP on it, but wants to keep Linux as a dual boot. How can i create a dual boot for this?
 
Old 04-21-2006, 12:29 AM   #2
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Rep: Reputation: 50
Cool help is at hand!

Firstly, hello and welcome to LQ.

This isn't as hard as it looks. have a search around the forum, as there are many discussions on this.

Basically, you need a floppy disk and a screwdriver.

Put grub on a floppy disk. Unplug the linux harddrive. Install the new harddrive. Remove the floppy disk. Do the windows XP install stuff. plug in the linux harddrive, put in the floppy disk, boot to linux. edit the grub menu so that you can boot windows from it. install grub to harddrive. (linux)

the details etc are much better explained at:
http://www.gnu.org/software/grub/manual/grub.html

post back to this thread with any questions.


Also: useful links- really. read these.
* http://wiki.linuxquestions.org/wiki/Grub
* booting windows on a second harddrive
* how to install windows wherever you want
* Howto: Grub Bootloader and Troubleshooter

hope this helps.

From someone who has done it a couple of times: Yes it does work, but windows can eat everything. BACKUP. Backup Everything. BACKUP.

cheers,

titanium_geek

Last edited by titanium_geek; 04-21-2006 at 12:38 AM. Reason: minor formatting
 
Old 04-21-2006, 06:07 AM   #3
debasish_5849
Member
 
Registered: Jan 2006
Location: India
Distribution: fedora core 5
Posts: 42

Rep: Reputation: 15
You don't need a screw driver nor even a floppy drive if you have the bootable installation disk of the linux distro. First just install windows on the second disk.
I will presume that the first hard drive is the primary master and the second is the primary slave.
After installing windows, boot with the installation CD, and type the following command in the command prompt that arrives at the begining:-

linux rescue
Follow the instructions until the command prompt arrives.
chroot to the installation image of your linux installation and type grub-install /dev/hda
reboot and boot from your hard drive and when in the ,linux environment add the following lines to your /etc/grub.conf file

title Windows
rootnoverify (hd1,0)
chainloader +1

Last edited by debasish_5849; 04-21-2006 at 06:10 AM.
 
Old 04-21-2006, 08:03 AM   #4
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Rep: Reputation: 50
the screw driver reference was humourous in intent- you do need some way to get into the Computer to change the harddrive, don't you? (unless you have those fancy thumb screws)

Windows loves to take over your computer. play it safe and disconnect the other harddrive, even if you go with the bootable cd method.

debasish_5849's method works if you have a well known distro (suse, fedora, mandriva etc).

Check the links, especially the gnu manual, since your setup might differ from debasish_5849's.

cheers.

titanium_geek

Last edited by titanium_geek; 04-21-2006 at 08:14 AM.
 
Old 04-21-2006, 11:36 AM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
I do a weekly install fest, actually a Linux Workshop; & I agree w/ titanium_geek -- protect the Linux install by disconnecting it during the Win install.


The GRUB stanza from debasish_5849 will probably work, but adding "makeactive" is sometimes helpful:
Code:
title "Winders"
rootnoverify (hd1,0)
makeactive
chainloader +1
Remember the title line is just the menu entry that will be displayed -- it can be anything the owner wants.
 
Old 04-24-2006, 09:07 AM   #6
statictiger
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Original Poster
Rep: Reputation: 0
someone gave me this code for grub:

default=0
timeout=60
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.4.22-1.2188.nptl)
root (hd0,0)
kernel /vmlinuz-2.4.22-1.2188.nptl ro root =LABEL=/hdd=ide-scsi rhgb
initrd /initrd-2.4.22-1.2188.nptl.img
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1)
chainloader +1

What file to i put this code into?
 
Old 04-24-2006, 06:21 PM   #7
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
1. /boot/grub/menu.lst
or
2. /boot/grub/grub.conf

#2 is the "traditional" name for the menu file, #1 is the new one.
 
Old 04-24-2006, 08:58 PM   #8
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Rep: Reputation: 50
what archtoad is saying: try one, if it doesn't work, try the other.

titanium_geek
 
Old 04-25-2006, 06:38 AM   #9
statictiger
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thank everyone who has helped me. I really appreciate it, and my friend does too. I think it's nice that you guys have taken time out of your schedule to help me with this.
 
Old 04-25-2006, 08:36 AM   #10
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
Thanks for amplifying my response, titanium_geek. I must have been in terse mode & should have said a little more for clarity's sake.
 
Old 04-26-2006, 07:05 AM   #11
titanium_geek
Senior Member
 
Registered: May 2002
Location: Melbourne Australia
Distribution: it died/ macosx
Posts: 2,478

Rep: Reputation: 50
Quote:
Originally Posted by statictiger
Thank everyone who has helped me. I really appreciate it, and my friend does too. I think it's nice that you guys have taken time out of your schedule to help me with this.
hey, that's what we're here for!


titanium_geek
 
  


Reply

Tags
dual boot, grub, windows xp


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
Is Grub necessary for Dual boot system JOR000 Linux - General 6 09-02-2005 12:28 PM
GRUB Dual Boot system errors with XP and Fedora 3 Armageddon00 Linux - Newbie 10 01-11-2005 03:29 PM
GRUB repair on dual boot system NickTheBubble Linux - Newbie 2 10-07-2004 01:06 PM
help! grub does not boot the system! dual HD, 3 OS parv Fedora 3 08-31-2004 08:40 AM
GRUB for LINUX to boot dual system kpilaiku Linux - General 2 04-11-2003 03:46 PM


All times are GMT -5. The time now is 06:47 PM.

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