LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (http://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Writing a Dual Boot System in Grub (http://www.linuxquestions.org/questions/linux-enterprise-47/writing-a-dual-boot-system-in-grub-437304/)

statictiger 04-20-2006 11:26 PM

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?

titanium_geek 04-21-2006 01:29 AM

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

debasish_5849 04-21-2006 07:07 AM

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

titanium_geek 04-21-2006 09:03 AM

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

archtoad6 04-21-2006 12:36 PM

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.

statictiger 04-24-2006 10:07 AM

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?

archtoad6 04-24-2006 07:21 PM

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.

titanium_geek 04-24-2006 09:58 PM

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

titanium_geek

statictiger 04-25-2006 07:38 AM

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.

archtoad6 04-25-2006 09:36 AM

Thanks for amplifying my response, titanium_geek. I must have been in terse mode & should have said a little more for clarity's sake.

titanium_geek 04-26-2006 08:05 AM

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


All times are GMT -5. The time now is 04:54 PM.