LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-03-2005, 01:49 PM   #1
cyberguy2
LQ Newbie
 
Registered: Oct 2005
Distribution: Red Hat Linux 9
Posts: 11

Rep: Reputation: 0
Dual boot problem in Redhat linux 9 (GRUB Lost)


Hi Everyone

I was having windows and linux (dual boot). I recently had to reinstall windows, though linux was perfect.

Now i am having a problem i formatted the C:\ drive to reinstall Windows.

Now the boot loader (GRUB) is lost and i can boot my PC to Windows only.

I tried installing XOSL but in vain. It didnt boot to Linux.

Is there any way i can boot to linux without reinstalling Linux.

Please Help Me
 
Old 11-03-2005, 02:19 PM   #2
druisgod
Member
 
Registered: Jun 2004
Location: Maine
Distribution: LFS Mint OS, LFS, CENTos,
Posts: 119

Rep: Reputation: 18
Ok. First I'm assuming that the c: drive you formatted didn't contain the linux partition as well, and that you have a linux partition still intact. If so, you should be able to boot with the original cdrom into rescue mode. (Putting your cd into the drive, booting the computer, and reading the initial screen that comes up should get you into rescue mode).

First off, the rescue mode might have the grub installer included, use that. If not, you can chroot (see chroots man page) to the mounted partition and use that to install grub again. Here is a link on installing grub in case you have questions.

click here

Hope this works.

~ Druisgod
 
Old 11-03-2005, 06:59 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
A little more explanation might help you understand what happened.

Windows is a very jealous operating system. It doesn't like any other system on the same computer. It will tempt you to reformat any other operating systems it finds. It will also ALWAYS write its own bootloader to the MBR (master boot record).

In order for grub to work, it must install part of itself to the MBR; the rest is in the /boot directory of the Linux installation. When you reinstalled Windows, it wrote its own bootloader to the MBR, overwriting the grub first stage which was there.

Now, in order to boot Linux, you need a boot disk. You can use the installation cd of the distro you installed as a boot disk, as druisgod pointed out.

For future reference, it would be a good idea to google up instructions on how to make a boot cd (or boot floppy if you have a floppy drive) for Linux, so that you need never have this problem again.
 
Old 11-03-2005, 11:37 PM   #4
cyberguy2
LQ Newbie
 
Registered: Oct 2005
Distribution: Red Hat Linux 9
Posts: 11

Original Poster
Rep: Reputation: 0
Thank You
But is there any way by which i can reinstall GRUB without booting to linux (i.e. from the linux rescue)
When i entered it threw up a console (text based) as i am new to linux installed 10 days ago(first time). I dont know what to do from the console. I typed grub in it and grub started and showed up
someting like this
grub>
i typed install it gave some error message.

Please give me the commands that would be needed to install GRUB from it.
 
Old 11-04-2005, 12:13 AM   #5
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
windows it seems is over jealous (*bigrigdriver) so it overwrites your MasterBootRecord (MBR) everytime you reinstall your windows os. this means your previous boot records (one that contains where to look for bootup script for linux and any other os you may have) are gone. now you can't boot any other os you may have except windows.
fortunately you have yourself a quite nice solution to it. (it only works if your other os'es are intact in your harddrive, meaning you have not formatted them while reinstalling your windows). you just take a bootable linux cd or floppy and boot your system from it. then in the prompt type 'linux rescue' and wait. a red window in the screen will tell you that your linux partition has been found but must be mounted before you can start using it and you have to do 'chroot /mnt...blah blah'-do it.
find the lilo.conf.anaconda file from /etc and copy it as lilo.conf in the same directory. (you may have to login as root) now open the lilo.conf file using some text editor (vi, emacs or whatever your choice is) then do something like this...
-----------------------------------------------------------------------------
prompt
timeout=30 /*wait this much msec before booting the default os*/
default=linux /*default os to boot-put dos for windows*/
boot=/dev/hda /*master HDD*/
map=/boot/map
install=/boot/boot.b
message=/boot/message /*any msg to display at boot time*/
lba32 /*force lba32 if size of your harddisk>20Gb*/

image=/boot/vmlinuz-2.4.21-4.EL
password=password/*linux single asks passwd*/
restricted
label=linux
initrd=/boot/initrd-2.4.21-4.EL.img
read-only
append="root=LABEL=/"

other=/dev/hda1 /*your windows partition*/
optional
label=DOS
--------------------------------------------------------------------------------
save and close it.
in the prompt type 'lilo'. it will show something like this..
--------------------------------------------------------------------------------
Added linux*
Added Dos
---------------------------------------------------------------------------------
this will install lilo bootloader instead of grub though its less powerful then grub it is the simplest.
since you too dual boot i suggest you keep a bootable cd of your linux system with you for always and DONOT* share it with your friends. GOD KNOWS when window crashes and you may have to reinstall it (this will frequently happen).

Last edited by prozac; 11-04-2005 at 12:19 AM.
 
Old 11-04-2005, 06:03 AM   #6
cyberguy2
LQ Newbie
 
Registered: Oct 2005
Distribution: Red Hat Linux 9
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you very much it solved my problem but is there any way i would backup the MBR instead of doing all these again in the future
 
Old 11-04-2005, 06:29 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,157

Rep: Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340Reputation: 3340
If you are now using lilo, you do *not* want to backup the MBR - even were the means to do so suggested to you.
Lilo uses an arcane method of locating itself from the loader code in the MBR - hence the need to continually run the lilo command when you update the conf file.

Restoring an old MBR would be a seriously bad idea. And that is without considering possible partition table changes.
Don't even think about it.
 
Old 11-04-2005, 06:33 AM   #8
druisgod
Member
 
Registered: Jun 2004
Location: Maine
Distribution: LFS Mint OS, LFS, CENTos,
Posts: 119

Rep: Reputation: 18
Unfortunately I don't believe there is a way to back up the MBR. Or at least to say, I haven't found a way. Its kind of *out of the realm of the FS*, so to speak. I would just have myself prepared for this anytime you need to reload windows. I had this issue myself once upon a time. I ended up doing some heavy investigating and found that everything I wanted to do and more with the exception of cutting edge gaming, could be done with linux. It wasn't a really hard transition as I thought it would be. G/L in the future.

~ Druisgod
 
Old 11-18-2005, 10:30 PM   #9
tinybit
Member
 
Registered: Jul 2005
Location: China
Distribution: Mandriva
Posts: 84

Rep: Reputation: 15
GRUB and LILO always conflict with Windows. And GNU GRUB is not so robust, causing many problems during boot.

So try GRUB for DOS please. It is a cross-platform boot loader based on GNU GRUB. The GRUB.EXE can be started from DOS/Win9x; and GRLDR can be started from BOOT.INI of Windows NT/2K/XP/2003; and even more, the GRUB.EXE can be started from LINUX via the KEXEC tool.

By using GRUB.EXE or GRLDR, you don't have to touch your MBR. It is the safest way coexisting with DOS/Windows.

You needn't install GRUB for DOS. Just run GRUB.EXE from DOS, or append a line of "C:\GRLDR=START GRUB" into your BOOT.INI(restart and select the "START GRUB" menu item), that will do.

Download GRUB for DOS here: http://freshmeat.net/projects/grub4dos/

There is a fat12grldr.img file with the GRUB for DOS release. You can create a GRUB bootable floppy with this fat12grldr.img file.

Or, you can just copy GRUB.EXE to your DOS floppy and run GRUB.EXE to enter the GRUB environment.

If the system has no DOS/WINDOWS, you may use the bootlace.com utility to write GRLDR boot record onto the MBR.
 
Old 11-19-2005, 12:01 AM   #10
cyberguy2
LQ Newbie
 
Registered: Oct 2005
Distribution: Red Hat Linux 9
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you i will try it out. But i cant understand how do i use it. Since i am new to linux.
 
Old 11-19-2005, 07:10 PM   #11
tinybit
Member
 
Registered: Jul 2005
Location: China
Distribution: Mandriva
Posts: 84

Rep: Reputation: 15
When GRUB4DOS starts, it will try to search menu.lst files in your Linux system and load it as the menu. You simply select the menu item or even do nothing, and your Linux should be started.

How to start GRUB4DOS? Here is the answer:

If your Windws is NT/2K/XP/20003, then copy GRLDR to the root dir of your Windows C: drive, and edit the file C:\BOOT.INI, add a new line "C:\GRLDR=START GRUB" to the end of the file, and restart Windows.

If your Windows is 98, simply boot to DOS and run GRUB.EXE.
 
Old 11-20-2005, 09:00 AM   #12
cyberguy2
LQ Newbie
 
Registered: Oct 2005
Distribution: Red Hat Linux 9
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you very much i have successfully installed grub for dos.
 
  


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
(another) Grub dual boot question with XP/Redhat agerkis Linux - Newbie 6 01-11-2011 02:14 PM
dual boot grub problems with redhat sfzombie13 Linux - General 5 07-17-2005 10:55 PM
grub dual boot redhat 8/win2k problem bsriveria Red Hat 1 02-10-2005 08:18 AM
help GRUB is lost! I need to boot Linux from HardDisk varunnarang Linux - Software 9 11-20-2004 11:19 AM
Dual boot Redhat Linux 9.0/Windows XP home NIC problem shawn_t Linux - Hardware 6 03-09-2004 12:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:35 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
Open Source Consulting | Domain Registration