LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-10-2004, 12:39 AM   #1
muthiahm
LQ Newbie
 
Registered: Jun 2004
Location: India
Distribution: Red Hat 7.2
Posts: 13

Rep: Reputation: 0
Installing Windows over Linux


Hi Friends,

I have installed Red hat linux on my computer. Now i want to install Windows XP on my system(Dual Booting). I heard that windows will overwrite MBR, so if i install will i lose my linux?

In one system i installed windows first and then linux, that had no problem. But what about installing winodws over linux? Help Me!


Regards,
Muthiah.M
 
Old 06-10-2004, 01:36 AM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
It would have been better to install Windows first, then Linux, but if you already installed Linux and now want to Windows, you can. As you know though, Windows will overwrite the MBR as part of its installation process. To restore, you will need to boot Linux with your rescue disk, then rerun lilo. -- J.W.
 
Old 06-10-2004, 02:47 AM   #3
muthiahm
LQ Newbie
 
Registered: Jun 2004
Location: India
Distribution: Red Hat 7.2
Posts: 13

Original Poster
Rep: Reputation: 0
But i have not created any boot disks for linux. What can i do now?

One more thing.. Do i have to use the boot disk everytime when i have to use linux. What is meaning of rerun lilo.

Plz explain me.

Regards,
Muthiah.M
 
Old 06-10-2004, 02:59 AM   #4
Qucho
Member
 
Registered: Mar 2004
Location: Colorado, US
Distribution: Debian "Sarge"
Posts: 228

Rep: Reputation: 30
When you run LILO it restores the bootloader. That IF you had LILO installed, if you had or like better GRUB then you need to run GRUB instead.

Since windows got rid of the bootloader thats why u need a boot floppy/CD, JUST to restore the bootloader with LILO or GRUB.

[edit] You can either download an image of a rescue floppy disk from the net, or burn a Knoppix CD (a live CD distro) wich is very nice for emergencies and fixing stuff) Google both.

Last edited by Qucho; 06-10-2004 at 03:01 AM.
 
Old 06-10-2004, 03:48 AM   #5
david_harvard
LQ Newbie
 
Registered: Jun 2004
Posts: 15

Rep: Reputation: 0
Installing Windows over Linux

Hi there,


Just tell me what you have installed at your boot loader, is it GRUB or LILO?

Yes, Windows is such operating system that when installed do not allow any other OS to stay with it. Installing Windows after installing Linux will overwrite the Linux GRUB or LILO. But, this can be resolved.

The rest is just the commands. Just let me know what you have installed GRUB or LILO.


regards
David Harvard
 
Old 06-10-2004, 04:24 AM   #6
muthiahm
LQ Newbie
 
Registered: Jun 2004
Location: India
Distribution: Red Hat 7.2
Posts: 13

Original Poster
Rep: Reputation: 0
Hi there,

I have installed GRUB as my boot loader
 
Old 06-10-2004, 06:19 AM   #7
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
OK, here's the deal, in simple terms.

When you install Windows, it will (as you know) install its bootloader over your current GRUB in the MBR.

The Windows bootloader does not know or care about Linux, so you will be unable to boot to Linux, but there will be no damage to the Linux system.

In order to gain access to both OSes, you will have to:

1) edit the GRUB menu so that it knows that Windows is now also available;

2) reinstall GRUB to the MBR so that the GRUB menu is displayed rather than the Windows one (not that Windows displays a menu if there's only one version of Windows on the box, but Windows does have a boot menu config file similar to GRUB's or LiLO's, and this file is read by the Windows bootloader).

The first RedHat CD is also a rescue disk. Once you have installed Windows, you can boot from RedHat CD1 and choose 'rescue" (sorry, don't so much know the details, as I don't use RedHat).

There should be an option to boot the installed RH system; there might even be an option to reinstall the bootloader. If so, take it, but otherwise, boot the installed RH system.

This should get you to single-user mode (console login as root).

Once there, you have two choices.

You can either try to fix both issues in one go (edit the GRUB configuration file with a console-based text editor so that it recognizes both Windows and Linux, and then reinstall GRUB);

Or you can fix the issues in order of importance (reinstall GRUB to the MBR from the console login, making Linux accessible but Windows temporarily inaccessible), and then boot into Linux and fix the GRUB configuration file from a GUI text editor.

Which option you choose depends on what you feel most comfortable with.

To reinstall GRUB to the MBR, from the console prompt type grub-install:

From info grub:
Quote:
If you still do want to install GRUB under a UNIX-like OS (such as
GNU), invoke the program `grub-install' (*note Invoking grub-install:
as the superuser ("root").

The usage is basically very simple. You only need to specify one
argument to the program, namely, where to install the boot loader. The
argument can be either a device file (like `/dev/hda') or a partition
specified in GRUB's notation. For example, under Linux the following
will install GRUB into the MBR of the first IDE disk:

# grub-install /dev/hda

Likewise, under GNU/Hurd, this has the same effect:

# grub-install /dev/hd0

If it is the first BIOS drive, this is the same as well:

# grub-install '(hd0)'
You could also read the GRUB manual for more complete information as to (re-)installing GRUB.

You could now mount the /boot partition (if /boot is a separate partition) and load /boot/grub/menu.lst (or /boot/grub/grub.conf, whichever one RH uses) and edit the GRUB configuration file with a console based text-editor such as nano, pico, or vi, if these are installed and you feel comfortable with using them.

If not, you should be able to reboot and boot into Linux from the restored GRUB menu, at which point you could mount /boot and open the configuration file in your GUI text editor of choice (as root). In either case, you'd need to edit the GRUB configuration file to include a Windows entry.

Naturally, we cannot know your particular system configuration (what drive you've installed Windows to, etc), but generally, your new entry needs to conform to the example found in HOWTO Restore GRUB:
Quote:
title WindowsME
rootnoverify (hd0,0)
chainloader +1
There are alternative manners of doing this, from preventing Windows from overwriting the MBR by switching drives and letting GRUB remap them so that Windows thinks that it's on the first drive when it isn't (outlined in Linux+Win9x+Grub HOWTO), or even putting Linux on the Windows bootloader rather than reinstalling GRUB (outlined in How to Dual Boot with Linux and Windows :: arul's technical site :: arul john).

But the first solution is the most common, and possibly the easiest, but that depends on your needs and experience.

Hope this helps.
 
Old 06-10-2004, 09:11 AM   #8
david_harvard
LQ Newbie
 
Registered: Jun 2004
Posts: 15

Rep: Reputation: 0
Installing Windows over Linux

Greetings,


Install Windows XP and you won't be able to start your computer in Linux. Then set your BIOS to CD-ROM support. Insert Red Hat Linux CD 1 and at the boot prompt type

linux rescue and then press enter.

It will search for the partition where Linux has been installed. You may be asked for the language and other stuff.

Once that is done you need to type chroot/mnt/sysimage and press enter (this command will be listed once it searches for the Linux partion).


Once this has been done just type
install-grub /dev/hda and press enter

This should reinstall the GRUB back. Let me know if this works.



regards

David Harvard
 
  


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
Installing Windows 98 with a Linux OS NirvanaII Linux - Software 2 07-18-2005 09:31 PM
Installing linux from windows... Jay_highlands Linux - General 3 10-07-2004 06:51 AM
Installing programs in linux? which progs? can linux do the things windows can? James-jmpm Linux - Newbie 6 07-02-2004 08:01 PM
----installing Windows 98 After Linux---- linuxbullet Linux - General 3 01-29-2004 02:52 AM
Installing windows over linux on a fully partitioned drive for linux reddon84 Linux - Software 2 01-26-2004 07:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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